<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-

This module contains miscellaneous functions related to renaming.

-}</span><span>
</span><span id="line-6"></span><span class="hs-pragma">{-# LANGUAGE FlexibleContexts #-}</span><span>
</span><span id="line-7"></span><span class="hs-pragma">{-# LANGUAGE ViewPatterns #-}</span><span>
</span><span id="line-8"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span>
</span><span id="line-9"></span><span>
</span><span id="line-10"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}</span><span>
</span><span id="line-11"></span><span>
</span><span id="line-12"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Rename.Utils</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-13"></span><span>        </span><span class="annot"><a href="GHC.Rename.Utils.html#checkDupRdrNames"><span class="hs-identifier">checkDupRdrNames</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#checkShadowedRdrNames"><span class="hs-identifier">checkShadowedRdrNames</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-14"></span><span>        </span><span class="annot"><a href="GHC.Rename.Utils.html#checkDupNames"><span class="hs-identifier">checkDupNames</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#checkDupAndShadowedNames"><span class="hs-identifier">checkDupAndShadowedNames</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#dupNamesErr"><span class="hs-identifier">dupNamesErr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-15"></span><span>        </span><span class="annot"><a href="GHC.Rename.Utils.html#checkTupSize"><span class="hs-identifier">checkTupSize</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-16"></span><span>        </span><span class="annot"><a href="GHC.Rename.Utils.html#addFvRn"><span class="hs-identifier">addFvRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#mapFvRn"><span class="hs-identifier">mapFvRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#mapMaybeFvRn"><span class="hs-identifier">mapMaybeFvRn</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-17"></span><span>        </span><span class="annot"><a href="GHC.Rename.Utils.html#warnUnusedMatches"><span class="hs-identifier">warnUnusedMatches</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#warnUnusedTypePatterns"><span class="hs-identifier">warnUnusedTypePatterns</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-18"></span><span>        </span><span class="annot"><a href="GHC.Rename.Utils.html#warnUnusedTopBinds"><span class="hs-identifier">warnUnusedTopBinds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#warnUnusedLocalBinds"><span class="hs-identifier">warnUnusedLocalBinds</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-19"></span><span>        </span><span class="annot"><a href="GHC.Rename.Utils.html#checkUnusedRecordWildcard"><span class="hs-identifier">checkUnusedRecordWildcard</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-20"></span><span>        </span><span class="annot"><a href="GHC.Rename.Utils.html#mkFieldEnv"><span class="hs-identifier">mkFieldEnv</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>        </span><span class="annot"><a href="GHC.Rename.Utils.html#unknownSubordinateErr"><span class="hs-identifier">unknownSubordinateErr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#badQualBndrErr"><span class="hs-identifier">badQualBndrErr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#typeAppErr"><span class="hs-identifier">typeAppErr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-22"></span><span>        </span><span class="annot"><a href="GHC.Rename.Utils.html#HsDocContext"><span class="hs-identifier">HsDocContext</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier">pprHsDocContext</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-23"></span><span>        </span><span class="annot"><a href="GHC.Rename.Utils.html#inHsDocContext"><span class="hs-identifier">inHsDocContext</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#withHsDocContext"><span class="hs-identifier">withHsDocContext</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span>        </span><span class="annot"><a href="GHC.Rename.Utils.html#newLocalBndrRn"><span class="hs-identifier">newLocalBndrRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#newLocalBndrsRn"><span class="hs-identifier">newLocalBndrsRn</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-26"></span><span>
</span><span id="line-27"></span><span>        </span><span class="annot"><a href="GHC.Rename.Utils.html#bindLocalNames"><span class="hs-identifier">bindLocalNames</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#bindLocalNamesFV"><span class="hs-identifier">bindLocalNamesFV</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span>        </span><span class="annot"><a href="GHC.Rename.Utils.html#addNameClashErrRn"><span class="hs-identifier">addNameClashErrRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#extendTyVarEnvFVRn"><span class="hs-identifier">extendTyVarEnvFVRn</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-30"></span><span>
</span><span id="line-31"></span><span>        </span><span class="annot"><a href="GHC.Rename.Utils.html#checkInferredVars"><span class="hs-identifier">checkInferredVars</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>        </span><span class="annot"><a href="GHC.Rename.Utils.html#noNestedForallsContextsErr"><span class="hs-identifier">noNestedForallsContextsErr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#addNoNestedForallsContextsErr"><span class="hs-identifier">addNoNestedForallsContextsErr</span></a></span><span>
</span><span id="line-33"></span><span class="hs-special">)</span><span>
</span><span id="line-34"></span><span>
</span><span id="line-35"></span><span class="hs-keyword">where</span><span>
</span><span id="line-36"></span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Hs.html"><span class="hs-identifier">GHC.Hs</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html"><span class="hs-identifier">GHC.Types.Name.Reader</span></a></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html"><span class="hs-identifier">GHC.Driver.Types</span></a></span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Env.html"><span class="hs-identifier">GHC.Tc.Utils.Env</span></a></span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html"><span class="hs-identifier">GHC.Tc.Utils.Monad</span></a></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html"><span class="hs-identifier">GHC.Types.Name.Set</span></a></span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html"><span class="hs-identifier">GHC.Types.Name.Env</span></a></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html"><span class="hs-identifier">GHC.Core.DataCon</span></a></span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">SrcLoc</span></span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#TopLevelFlag"><span class="hs-identifier">TopLevelFlag</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.List.SetOps.html"><span class="hs-identifier">GHC.Data.List.SetOps</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Data.List.SetOps.html#removeDups"><span class="hs-identifier">removeDups</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html"><span class="hs-identifier">GHC.Data.Maybe</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html#whenIsJust"><span class="hs-identifier">whenIsJust</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Settings.Constants.html"><span class="hs-identifier">GHC.Settings.Constants</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Settings.Constants.html#mAX_TUPLE_SIZE"><span class="hs-identifier">mAX_TUPLE_SIZE</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-61"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Data.List.NonEmpty.html#"><span class="hs-identifier">Data.List.NonEmpty</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">NE</span></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.LanguageExtensions.html#"><span class="hs-identifier">GHC.LanguageExtensions</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">LangExt</span></span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span class="hs-comment">{-
*********************************************************
*                                                      *
\subsection{Binding}
*                                                      *
*********************************************************
-}</span><span>
</span><span id="line-71"></span><span>
</span><span id="line-72"></span><span class="annot"><a href="GHC.Rename.Utils.html#newLocalBndrRn"><span class="hs-identifier hs-type">newLocalBndrRn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-73"></span><span class="hs-comment">-- Used for non-top-level binders.  These should</span><span>
</span><span id="line-74"></span><span class="hs-comment">-- never be qualified.</span><span>
</span><span id="line-75"></span><span id="newLocalBndrRn"><span class="annot"><span class="annottext">newLocalBndrRn :: Located RdrName -&gt; RnM Name
</span><a href="GHC.Rename.Utils.html#newLocalBndrRn"><span class="hs-identifier hs-var hs-var">newLocalBndrRn</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681108884"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681108884"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681108883"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681108883"><span class="hs-identifier hs-var">rdr_name</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-76"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681108882"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108882"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; Maybe Name
</span><a href="GHC.Types.Name.Reader.html#isExact_maybe"><span class="hs-identifier hs-var">isExact_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681108883"><span class="hs-identifier hs-var">rdr_name</span></a></span><span>
</span><span id="line-77"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; RnM Name
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108882"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-comment">-- This happens in code generated by Template Haskell</span><span>
</span><span id="line-78"></span><span>                </span><span class="hs-comment">-- See Note [Binders in Template Haskell] in &quot;GHC.ThToHs&quot;</span><span>
</span><span id="line-79"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-80"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">Bool
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName -&gt; Bool
</span><a href="GHC.Types.Name.Reader.html#isUnqual"><span class="hs-identifier hs-var">isUnqual</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681108883"><span class="hs-identifier hs-var">rdr_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-81"></span><span>                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#addErrAt"><span class="hs-identifier hs-var">addErrAt</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681108884"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName -&gt; MsgDoc
</span><a href="GHC.Rename.Utils.html#badQualBndrErr"><span class="hs-identifier hs-var">badQualBndrErr</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681108883"><span class="hs-identifier hs-var">rdr_name</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-82"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681108877"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681108877"><span class="hs-identifier hs-var">uniq</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf TcGblEnv TcLclEnv Unique
forall gbl lcl. TcRnIf gbl lcl Unique
</span><a href="GHC.Tc.Utils.Monad.html#newUnique"><span class="hs-identifier hs-var">newUnique</span></a></span><span>
</span><span id="line-83"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Name -&gt; RnM Name
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unique -&gt; OccName -&gt; SrcSpan -&gt; Name
</span><a href="GHC.Types.Name.html#mkInternalName"><span class="hs-identifier hs-var">mkInternalName</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681108877"><span class="hs-identifier hs-var">uniq</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName -&gt; OccName
</span><a href="GHC.Types.Name.Reader.html#rdrNameOcc"><span class="hs-identifier hs-var">rdrNameOcc</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681108883"><span class="hs-identifier hs-var">rdr_name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681108884"><span class="hs-identifier hs-var">loc</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-84"></span><span>
</span><span id="line-85"></span><span class="annot"><a href="GHC.Rename.Utils.html#newLocalBndrsRn"><span class="hs-identifier hs-type">newLocalBndrsRn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-86"></span><span id="newLocalBndrsRn"><span class="annot"><span class="annottext">newLocalBndrsRn :: [Located RdrName] -&gt; RnM [Name]
</span><a href="GHC.Rename.Utils.html#newLocalBndrsRn"><span class="hs-identifier hs-var hs-var">newLocalBndrsRn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Located RdrName -&gt; RnM Name) -&gt; [Located RdrName] -&gt; RnM [Name]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName -&gt; RnM Name
</span><a href="GHC.Rename.Utils.html#newLocalBndrRn"><span class="hs-identifier hs-var">newLocalBndrRn</span></a></span><span>
</span><span id="line-87"></span><span>
</span><span id="line-88"></span><span id="local-6989586621681109135"><span class="annot"><a href="GHC.Rename.Utils.html#bindLocalNames"><span class="hs-identifier hs-type">bindLocalNames</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681109135"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681109135"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-89"></span><span id="bindLocalNames"><span class="annot"><span class="annottext">bindLocalNames :: forall a. [Name] -&gt; RnM a -&gt; RnM a
</span><a href="GHC.Rename.Utils.html#bindLocalNames"><span class="hs-identifier hs-var hs-var">bindLocalNames</span></a></span></span><span> </span><span id="local-6989586621681108871"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108871"><span class="hs-identifier hs-var">names</span></a></span></span><span> </span><span id="local-6989586621681108870"><span class="annot"><span class="annottext">RnM a
</span><a href="#local-6989586621681108870"><span class="hs-identifier hs-var">enclosed_scope</span></a></span></span><span>
</span><span id="line-90"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681108869"><span class="annot"><span class="annottext">TcLclEnv
</span><a href="#local-6989586621681108869"><span class="hs-identifier hs-var">lcl_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf TcGblEnv TcLclEnv TcLclEnv
forall gbl lcl. TcRnIf gbl lcl lcl
</span><a href="GHC.Tc.Utils.Monad.html#getLclEnv"><span class="hs-identifier hs-var">getLclEnv</span></a></span><span>
</span><span id="line-91"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681108867"><span class="annot"><span class="annottext">th_level :: Int
</span><a href="#local-6989586621681108867"><span class="hs-identifier hs-var hs-var">th_level</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ThStage -&gt; Int
</span><a href="GHC.Tc.Types.html#thLevel"><span class="hs-identifier hs-var">thLevel</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcLclEnv -&gt; ThStage
</span><a href="GHC.Tc.Types.html#tcl_th_ctxt"><span class="hs-identifier hs-var hs-var">tcl_th_ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">TcLclEnv
</span><a href="#local-6989586621681108869"><span class="hs-identifier hs-var">lcl_env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-92"></span><span>             </span><span id="local-6989586621681108864"><span class="annot"><span class="annottext">th_bndrs' :: NameEnv (TopLevelFlag, Int)
</span><a href="#local-6989586621681108864"><span class="hs-identifier hs-var hs-var">th_bndrs'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameEnv (TopLevelFlag, Int)
-&gt; [(Name, (TopLevelFlag, Int))] -&gt; NameEnv (TopLevelFlag, Int)
forall a. NameEnv a -&gt; [(Name, a)] -&gt; NameEnv a
</span><a href="GHC.Types.Name.Env.html#extendNameEnvList"><span class="hs-identifier hs-var">extendNameEnvList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcLclEnv -&gt; NameEnv (TopLevelFlag, Int)
</span><a href="GHC.Tc.Types.html#tcl_th_bndrs"><span class="hs-identifier hs-var hs-var">tcl_th_bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">TcLclEnv
</span><a href="#local-6989586621681108869"><span class="hs-identifier hs-var">lcl_env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-93"></span><span>                           </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108861"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TopLevelFlag
</span><a href="GHC.Types.Basic.html#NotTopLevel"><span class="hs-identifier hs-var">NotTopLevel</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681108867"><span class="hs-identifier hs-var">th_level</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681108861"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108861"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108871"><span class="hs-identifier hs-var">names</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-94"></span><span>             </span><span id="local-6989586621681108859"><span class="annot"><span class="annottext">rdr_env' :: LocalRdrEnv
</span><a href="#local-6989586621681108859"><span class="hs-identifier hs-var hs-var">rdr_env'</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LocalRdrEnv -&gt; [Name] -&gt; LocalRdrEnv
</span><a href="GHC.Types.Name.Reader.html#extendLocalRdrEnvList"><span class="hs-identifier hs-var">extendLocalRdrEnvList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcLclEnv -&gt; LocalRdrEnv
</span><a href="GHC.Tc.Types.html#tcl_rdr"><span class="hs-identifier hs-var hs-var">tcl_rdr</span></a></span><span> </span><span class="annot"><span class="annottext">TcLclEnv
</span><a href="#local-6989586621681108869"><span class="hs-identifier hs-var">lcl_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108871"><span class="hs-identifier hs-var">names</span></a></span><span>
</span><span id="line-95"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">TcLclEnv -&gt; RnM a -&gt; RnM a
forall lcl' gbl a lcl.
lcl' -&gt; TcRnIf gbl lcl' a -&gt; TcRnIf gbl lcl a
</span><a href="GHC.Tc.Utils.Monad.html#setLclEnv"><span class="hs-identifier hs-var">setLclEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcLclEnv
</span><a href="#local-6989586621681108869"><span class="hs-identifier hs-var">lcl_env</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tcl_th_bndrs :: NameEnv (TopLevelFlag, Int)
</span><a href="GHC.Tc.Types.html#tcl_th_bndrs"><span class="hs-identifier hs-var">tcl_th_bndrs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameEnv (TopLevelFlag, Int)
</span><a href="#local-6989586621681108864"><span class="hs-identifier hs-var">th_bndrs'</span></a></span><span>
</span><span id="line-96"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcl_rdr :: LocalRdrEnv
</span><a href="GHC.Tc.Types.html#tcl_rdr"><span class="hs-identifier hs-var">tcl_rdr</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LocalRdrEnv
</span><a href="#local-6989586621681108859"><span class="hs-identifier hs-var">rdr_env'</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-97"></span><span>                    </span><span class="annot"><span class="annottext">RnM a
</span><a href="#local-6989586621681108870"><span class="hs-identifier hs-var">enclosed_scope</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-98"></span><span>
</span><span id="line-99"></span><span id="local-6989586621681109122"><span class="annot"><a href="GHC.Rename.Utils.html#bindLocalNamesFV"><span class="hs-identifier hs-type">bindLocalNamesFV</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681109122"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681109122"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-100"></span><span id="bindLocalNamesFV"><span class="annot"><span class="annottext">bindLocalNamesFV :: forall a. [Name] -&gt; RnM (a, FreeVars) -&gt; RnM (a, FreeVars)
</span><a href="GHC.Rename.Utils.html#bindLocalNamesFV"><span class="hs-identifier hs-var hs-var">bindLocalNamesFV</span></a></span></span><span> </span><span id="local-6989586621681108853"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108853"><span class="hs-identifier hs-var">names</span></a></span></span><span> </span><span id="local-6989586621681108852"><span class="annot"><span class="annottext">RnM (a, FreeVars)
</span><a href="#local-6989586621681108852"><span class="hs-identifier hs-var">enclosed_scope</span></a></span></span><span>
</span><span id="line-101"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681108851"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681108851"><span class="hs-identifier hs-var">result</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681108850"><span class="annot"><span class="annottext">FreeVars
</span><a href="#local-6989586621681108850"><span class="hs-identifier hs-var">fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; RnM (a, FreeVars) -&gt; RnM (a, FreeVars)
forall a. [Name] -&gt; RnM a -&gt; RnM a
</span><a href="GHC.Rename.Utils.html#bindLocalNames"><span class="hs-identifier hs-var">bindLocalNames</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108853"><span class="hs-identifier hs-var">names</span></a></span><span> </span><span class="annot"><span class="annottext">RnM (a, FreeVars)
</span><a href="#local-6989586621681108852"><span class="hs-identifier hs-var">enclosed_scope</span></a></span><span>
</span><span id="line-102"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(a, FreeVars) -&gt; RnM (a, FreeVars)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681108851"><span class="hs-identifier hs-var">result</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; FreeVars -&gt; FreeVars
</span><a href="GHC.Types.Name.Set.html#delFVs"><span class="hs-identifier hs-var">delFVs</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108853"><span class="hs-identifier hs-var">names</span></a></span><span> </span><span class="annot"><span class="annottext">FreeVars
</span><a href="#local-6989586621681108850"><span class="hs-identifier hs-var">fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-103"></span><span>
</span><span id="line-104"></span><span class="hs-comment">-------------------------------------</span><span>
</span><span id="line-105"></span><span>
</span><span id="line-106"></span><span id="local-6989586621681108848"><span class="annot"><a href="GHC.Rename.Utils.html#extendTyVarEnvFVRn"><span class="hs-identifier hs-type">extendTyVarEnvFVRn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681108848"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681108848"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-107"></span><span id="extendTyVarEnvFVRn"><span class="annot"><span class="annottext">extendTyVarEnvFVRn :: forall a. [Name] -&gt; RnM (a, FreeVars) -&gt; RnM (a, FreeVars)
</span><a href="GHC.Rename.Utils.html#extendTyVarEnvFVRn"><span class="hs-identifier hs-var hs-var">extendTyVarEnvFVRn</span></a></span></span><span> </span><span id="local-6989586621681108847"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108847"><span class="hs-identifier hs-var">tyvars</span></a></span></span><span> </span><span id="local-6989586621681108846"><span class="annot"><span class="annottext">RnM (a, FreeVars)
</span><a href="#local-6989586621681108846"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; RnM (a, FreeVars) -&gt; RnM (a, FreeVars)
forall a. [Name] -&gt; RnM (a, FreeVars) -&gt; RnM (a, FreeVars)
</span><a href="GHC.Rename.Utils.html#bindLocalNamesFV"><span class="hs-identifier hs-var">bindLocalNamesFV</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108847"><span class="hs-identifier hs-var">tyvars</span></a></span><span> </span><span class="annot"><span class="annottext">RnM (a, FreeVars)
</span><a href="#local-6989586621681108846"><span class="hs-identifier hs-var">thing_inside</span></a></span><span>
</span><span id="line-108"></span><span>
</span><span id="line-109"></span><span class="hs-comment">-------------------------------------</span><span>
</span><span id="line-110"></span><span class="annot"><a href="GHC.Rename.Utils.html#checkDupRdrNames"><span class="hs-identifier hs-type">checkDupRdrNames</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-111"></span><span class="hs-comment">-- Check for duplicated names in a binding group</span><span>
</span><span id="line-112"></span><span id="checkDupRdrNames"><span class="annot"><span class="annottext">checkDupRdrNames :: [Located RdrName] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#checkDupRdrNames"><span class="hs-identifier hs-var hs-var">checkDupRdrNames</span></a></span></span><span> </span><span id="local-6989586621681108845"><span class="annot"><span class="annottext">[Located RdrName]
</span><a href="#local-6989586621681108845"><span class="hs-identifier hs-var">rdr_names_w_loc</span></a></span></span><span>
</span><span id="line-113"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(NonEmpty (Located RdrName) -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; [NonEmpty (Located RdrName)] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Located RdrName -&gt; SrcSpan)
-&gt; NonEmpty (Located RdrName) -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall n.
Outputable n =&gt;
(n -&gt; SrcSpan) -&gt; NonEmpty n -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#dupNamesErr"><span class="hs-identifier hs-var">dupNamesErr</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName -&gt; SrcSpan
forall l e. GenLocated l e -&gt; l
</span><a href="GHC.Types.SrcLoc.html#getLoc"><span class="hs-identifier hs-var">getLoc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[NonEmpty (Located RdrName)]
</span><a href="#local-6989586621681108842"><span class="hs-identifier hs-var">dups</span></a></span><span>
</span><span id="line-114"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-115"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Located RdrName]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681108842"><span class="annot"><span class="annottext">[NonEmpty (Located RdrName)]
</span><a href="#local-6989586621681108842"><span class="hs-identifier hs-var">dups</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Located RdrName -&gt; Located RdrName -&gt; Ordering)
-&gt; [Located RdrName]
-&gt; ([Located RdrName], [NonEmpty (Located RdrName)])
forall a. (a -&gt; a -&gt; Ordering) -&gt; [a] -&gt; ([a], [NonEmpty a])
</span><a href="GHC.Data.List.SetOps.html#removeDups"><span class="hs-identifier hs-var">removeDups</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681108841"><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681108841"><span class="hs-identifier hs-var">n1</span></a></span></span><span> </span><span id="local-6989586621681108840"><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681108840"><span class="hs-identifier hs-var">n2</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Located RdrName -&gt; RdrName
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681108841"><span class="hs-identifier hs-var">n1</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; RdrName -&gt; Ordering
forall a. Ord a =&gt; a -&gt; a -&gt; Ordering
</span><span class="hs-operator hs-var">`compare`</span></span><span> </span><span class="annot"><span class="annottext">Located RdrName -&gt; RdrName
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681108840"><span class="hs-identifier hs-var">n2</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Located RdrName]
</span><a href="#local-6989586621681108845"><span class="hs-identifier hs-var">rdr_names_w_loc</span></a></span><span>
</span><span id="line-116"></span><span>
</span><span id="line-117"></span><span class="annot"><a href="GHC.Rename.Utils.html#checkDupNames"><span class="hs-identifier hs-type">checkDupNames</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-118"></span><span class="hs-comment">-- Check for duplicated names in a binding group</span><span>
</span><span id="line-119"></span><span id="checkDupNames"><span class="annot"><span class="annottext">checkDupNames :: [Name] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#checkDupNames"><span class="hs-identifier hs-var hs-var">checkDupNames</span></a></span></span><span> </span><span id="local-6989586621681108837"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108837"><span class="hs-identifier hs-var">names</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#check_dup_names"><span class="hs-identifier hs-var">check_dup_names</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Name -&gt; Bool) -&gt; [Name] -&gt; [Name]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="GHC.Utils.Misc.html#filterOut"><span class="hs-identifier hs-var">filterOut</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Types.Name.html#isSystemName"><span class="hs-identifier hs-var">isSystemName</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108837"><span class="hs-identifier hs-var">names</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-120"></span><span>                </span><span class="hs-comment">-- See Note [Binders in Template Haskell] in &quot;GHC.ThToHs&quot;</span><span>
</span><span id="line-121"></span><span>
</span><span id="line-122"></span><span class="annot"><a href="GHC.Rename.Utils.html#check_dup_names"><span class="hs-identifier hs-type">check_dup_names</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-123"></span><span id="check_dup_names"><span class="annot"><span class="annottext">check_dup_names :: [Name] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#check_dup_names"><span class="hs-identifier hs-var hs-var">check_dup_names</span></a></span></span><span> </span><span id="local-6989586621681108833"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108833"><span class="hs-identifier hs-var">names</span></a></span></span><span>
</span><span id="line-124"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(NonEmpty Name -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; [NonEmpty Name] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Name -&gt; SrcSpan)
-&gt; NonEmpty Name -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall n.
Outputable n =&gt;
(n -&gt; SrcSpan) -&gt; NonEmpty n -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#dupNamesErr"><span class="hs-identifier hs-var">dupNamesErr</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; SrcSpan
</span><a href="GHC.Types.Name.html#nameSrcSpan"><span class="hs-identifier hs-var">nameSrcSpan</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[NonEmpty Name]
</span><a href="#local-6989586621681108831"><span class="hs-identifier hs-var">dups</span></a></span><span>
</span><span id="line-125"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-126"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Name]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681108831"><span class="annot"><span class="annottext">[NonEmpty Name]
</span><a href="#local-6989586621681108831"><span class="hs-identifier hs-var">dups</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Name -&gt; Name -&gt; Ordering) -&gt; [Name] -&gt; ([Name], [NonEmpty Name])
forall a. (a -&gt; a -&gt; Ordering) -&gt; [a] -&gt; ([a], [NonEmpty a])
</span><a href="GHC.Data.List.SetOps.html#removeDups"><span class="hs-identifier hs-var">removeDups</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681108830"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108830"><span class="hs-identifier hs-var">n1</span></a></span></span><span> </span><span id="local-6989586621681108829"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108829"><span class="hs-identifier hs-var">n2</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108830"><span class="hs-identifier hs-var">n1</span></a></span><span> </span><span class="annot"><span class="annottext">OccName -&gt; OccName -&gt; Ordering
forall a. Ord a =&gt; a -&gt; a -&gt; Ordering
</span><span class="hs-operator hs-var">`compare`</span></span><span> </span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108829"><span class="hs-identifier hs-var">n2</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108833"><span class="hs-identifier hs-var">names</span></a></span><span>
</span><span id="line-127"></span><span>
</span><span id="line-128"></span><span class="hs-comment">---------------------</span><span>
</span><span id="line-129"></span><span class="annot"><a href="GHC.Rename.Utils.html#checkShadowedRdrNames"><span class="hs-identifier hs-type">checkShadowedRdrNames</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-130"></span><span id="checkShadowedRdrNames"><span class="annot"><span class="annottext">checkShadowedRdrNames :: [Located RdrName] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#checkShadowedRdrNames"><span class="hs-identifier hs-var hs-var">checkShadowedRdrNames</span></a></span></span><span> </span><span id="local-6989586621681108827"><span class="annot"><span class="annottext">[Located RdrName]
</span><a href="#local-6989586621681108827"><span class="hs-identifier hs-var">loc_rdr_names</span></a></span></span><span>
</span><span id="line-131"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681108826"><span class="annot"><span class="annottext">(GlobalRdrEnv, LocalRdrEnv)
</span><a href="#local-6989586621681108826"><span class="hs-identifier hs-var">envs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRn (GlobalRdrEnv, LocalRdrEnv)
</span><a href="GHC.Tc.Utils.Monad.html#getRdrEnvs"><span class="hs-identifier hs-var">getRdrEnvs</span></a></span><span>
</span><span id="line-132"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(GlobalRdrEnv, LocalRdrEnv)
-&gt; (Located RdrName -&gt; (SrcSpan, OccName))
-&gt; [Located RdrName]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a.
(GlobalRdrEnv, LocalRdrEnv)
-&gt; (a -&gt; (SrcSpan, OccName))
-&gt; [a]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#checkShadowedOccs"><span class="hs-identifier hs-var">checkShadowedOccs</span></a></span><span> </span><span class="annot"><span class="annottext">(GlobalRdrEnv, LocalRdrEnv)
</span><a href="#local-6989586621681108826"><span class="hs-identifier hs-var">envs</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName -&gt; (SrcSpan, OccName)
forall {a}. GenLocated a RdrName -&gt; (a, OccName)
</span><a href="#local-6989586621681108823"><span class="hs-identifier hs-var">get_loc_occ</span></a></span><span> </span><span class="annot"><span class="annottext">[Located RdrName]
</span><a href="#local-6989586621681108822"><span class="hs-identifier hs-var">filtered_rdrs</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-133"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-134"></span><span>    </span><span id="local-6989586621681108822"><span class="annot"><span class="annottext">filtered_rdrs :: [Located RdrName]
</span><a href="#local-6989586621681108822"><span class="hs-identifier hs-var hs-var">filtered_rdrs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Located RdrName -&gt; Bool) -&gt; [Located RdrName] -&gt; [Located RdrName]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="GHC.Utils.Misc.html#filterOut"><span class="hs-identifier hs-var">filterOut</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName -&gt; Bool
</span><a href="GHC.Types.Name.Reader.html#isExact"><span class="hs-identifier hs-var">isExact</span></a></span><span> </span><span class="annot"><span class="annottext">(RdrName -&gt; Bool)
-&gt; (Located RdrName -&gt; RdrName) -&gt; Located RdrName -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName -&gt; RdrName
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Located RdrName]
</span><a href="#local-6989586621681108827"><span class="hs-identifier hs-var">loc_rdr_names</span></a></span><span>
</span><span id="line-135"></span><span>                </span><span class="hs-comment">-- See Note [Binders in Template Haskell] in &quot;GHC.ThToHs&quot;</span><span>
</span><span id="line-136"></span><span>    </span><span id="local-6989586621681108823"><span class="annot"><span class="annottext">get_loc_occ :: GenLocated a RdrName -&gt; (a, OccName)
</span><a href="#local-6989586621681108823"><span class="hs-identifier hs-var hs-var">get_loc_occ</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681108819"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681108819"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681108818"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681108818"><span class="hs-identifier hs-var">rdr</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681108819"><span class="hs-identifier hs-var">loc</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">RdrName -&gt; OccName
</span><a href="GHC.Types.Name.Reader.html#rdrNameOcc"><span class="hs-identifier hs-var">rdrNameOcc</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681108818"><span class="hs-identifier hs-var">rdr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-137"></span><span>
</span><span id="line-138"></span><span class="annot"><a href="GHC.Rename.Utils.html#checkDupAndShadowedNames"><span class="hs-identifier hs-type">checkDupAndShadowedNames</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrEnv"><span class="hs-identifier hs-type">GlobalRdrEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#LocalRdrEnv"><span class="hs-identifier hs-type">LocalRdrEnv</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-139"></span><span id="checkDupAndShadowedNames"><span class="annot"><span class="annottext">checkDupAndShadowedNames :: (GlobalRdrEnv, LocalRdrEnv)
-&gt; [Name] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#checkDupAndShadowedNames"><span class="hs-identifier hs-var hs-var">checkDupAndShadowedNames</span></a></span></span><span> </span><span id="local-6989586621681108817"><span class="annot"><span class="annottext">(GlobalRdrEnv, LocalRdrEnv)
</span><a href="#local-6989586621681108817"><span class="hs-identifier hs-var">envs</span></a></span></span><span> </span><span id="local-6989586621681108816"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108816"><span class="hs-identifier hs-var">names</span></a></span></span><span>
</span><span id="line-140"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#check_dup_names"><span class="hs-identifier hs-var">check_dup_names</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108815"><span class="hs-identifier hs-var">filtered_names</span></a></span><span>
</span><span id="line-141"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(GlobalRdrEnv, LocalRdrEnv)
-&gt; (Name -&gt; (SrcSpan, OccName))
-&gt; [Name]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a.
(GlobalRdrEnv, LocalRdrEnv)
-&gt; (a -&gt; (SrcSpan, OccName))
-&gt; [a]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#checkShadowedOccs"><span class="hs-identifier hs-var">checkShadowedOccs</span></a></span><span> </span><span class="annot"><span class="annottext">(GlobalRdrEnv, LocalRdrEnv)
</span><a href="#local-6989586621681108817"><span class="hs-identifier hs-var">envs</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; (SrcSpan, OccName)
</span><a href="#local-6989586621681108814"><span class="hs-identifier hs-var">get_loc_occ</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108815"><span class="hs-identifier hs-var">filtered_names</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-142"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-143"></span><span>    </span><span id="local-6989586621681108815"><span class="annot"><span class="annottext">filtered_names :: [Name]
</span><a href="#local-6989586621681108815"><span class="hs-identifier hs-var hs-var">filtered_names</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Name -&gt; Bool) -&gt; [Name] -&gt; [Name]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="GHC.Utils.Misc.html#filterOut"><span class="hs-identifier hs-var">filterOut</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Types.Name.html#isSystemName"><span class="hs-identifier hs-var">isSystemName</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108816"><span class="hs-identifier hs-var">names</span></a></span><span>
</span><span id="line-144"></span><span>                </span><span class="hs-comment">-- See Note [Binders in Template Haskell] in &quot;GHC.ThToHs&quot;</span><span>
</span><span id="line-145"></span><span>    </span><span id="local-6989586621681108814"><span class="annot"><span class="annottext">get_loc_occ :: Name -&gt; (SrcSpan, OccName)
</span><a href="#local-6989586621681108814"><span class="hs-identifier hs-var hs-var">get_loc_occ</span></a></span></span><span> </span><span id="local-6989586621681108813"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108813"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SrcSpan
</span><a href="GHC.Types.Name.html#nameSrcSpan"><span class="hs-identifier hs-var">nameSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108813"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108813"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-146"></span><span>
</span><span id="line-147"></span><span class="hs-comment">-------------------------------------</span><span>
</span><span id="line-148"></span><span id="local-6989586621681109104"><span class="annot"><a href="GHC.Rename.Utils.html#checkShadowedOccs"><span class="hs-identifier hs-type">checkShadowedOccs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrEnv"><span class="hs-identifier hs-type">GlobalRdrEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#LocalRdrEnv"><span class="hs-identifier hs-type">LocalRdrEnv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-149"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681109104"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccName"><span class="hs-identifier hs-type">OccName</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-150"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621681109104"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-151"></span><span id="checkShadowedOccs"><span class="annot"><span class="annottext">checkShadowedOccs :: forall a.
(GlobalRdrEnv, LocalRdrEnv)
-&gt; (a -&gt; (SrcSpan, OccName))
-&gt; [a]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#checkShadowedOccs"><span class="hs-identifier hs-var hs-var">checkShadowedOccs</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681108793"><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681108793"><span class="hs-identifier hs-var">global_env</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681108792"><span class="annot"><span class="annottext">LocalRdrEnv
</span><a href="#local-6989586621681108792"><span class="hs-identifier hs-var">local_env</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681108791"><span class="annot"><span class="annottext">a -&gt; (SrcSpan, OccName)
</span><a href="#local-6989586621681108791"><span class="hs-identifier hs-var">get_loc_occ</span></a></span></span><span> </span><span id="local-6989586621681108790"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681108790"><span class="hs-identifier hs-var">ns</span></a></span></span><span>
</span><span id="line-152"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WarningFlag
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall gbl lcl.
WarningFlag -&gt; TcRnIf gbl lcl () -&gt; TcRnIf gbl lcl ()
</span><a href="GHC.Tc.Utils.Monad.html#whenWOptM"><span class="hs-identifier hs-var">whenWOptM</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnNameShadowing"><span class="hs-identifier hs-var">Opt_WarnNameShadowing</span></a></span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env TcGblEnv TcLclEnv) ()
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-153"></span><span>    </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#traceRn"><span class="hs-identifier hs-var">traceRn</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;checkShadowedOccs:shadow&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(SrcSpan, OccName)] -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; (SrcSpan, OccName)) -&gt; [a] -&gt; [(SrcSpan, OccName)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; (SrcSpan, OccName)
</span><a href="#local-6989586621681108791"><span class="hs-identifier hs-var">get_loc_occ</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681108790"><span class="hs-identifier hs-var">ns</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-154"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(a -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; [a] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="#local-6989586621681108785"><span class="hs-identifier hs-var">check_shadow</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681108790"><span class="hs-identifier hs-var">ns</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-155"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-156"></span><span>    </span><span id="local-6989586621681108785"><span class="annot"><span class="annottext">check_shadow :: a -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="#local-6989586621681108785"><span class="hs-identifier hs-var hs-var">check_shadow</span></a></span></span><span> </span><span id="local-6989586621681108784"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681108784"><span class="hs-identifier hs-var">n</span></a></span></span><span>
</span><span id="line-157"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">OccName -&gt; Bool
</span><a href="GHC.Types.Name.Occurrence.html#startsWithUnderscore"><span class="hs-identifier hs-var">startsWithUnderscore</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681108782"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- Do not report shadowing for &quot;_x&quot;</span><span>
</span><span id="line-158"></span><span>                                                </span><span class="hs-comment">-- See #3262</span><span>
</span><span id="line-159"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681108781"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108781"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621681108780"><span class="hs-identifier hs-var">mb_local</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="#local-6989586621681108779"><span class="hs-identifier hs-var">complain</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;bound at&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SrcLoc -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SrcLoc
</span><a href="GHC.Types.Name.html#nameSrcLoc"><span class="hs-identifier hs-var">nameSrcLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108781"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-160"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681108775"><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681108775"><span class="hs-identifier hs-var">gres'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(GlobalRdrElt -&gt; IOEnv (Env TcGblEnv TcLclEnv) Bool)
-&gt; [GlobalRdrElt] -&gt; IOEnv (Env TcGblEnv TcLclEnv) [GlobalRdrElt]
forall (m :: * -&gt; *) a.
Applicative m =&gt;
(a -&gt; m Bool) -&gt; [a] -&gt; m [a]
</span><a href="../../base/src/Control.Monad.html#filterM"><span class="hs-identifier hs-var">filterM</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; IOEnv (Env TcGblEnv TcLclEnv) Bool
</span><a href="#local-6989586621681108773"><span class="hs-identifier hs-var">is_shadowed_gre</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681108772"><span class="hs-identifier hs-var">gres</span></a></span><span>
</span><span id="line-161"></span><span>                         </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="#local-6989586621681108779"><span class="hs-identifier hs-var">complain</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(GlobalRdrElt -&gt; MsgDoc) -&gt; [GlobalRdrElt] -&gt; [MsgDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; MsgDoc
</span><a href="GHC.Types.Name.Reader.html#pprNameProvenance"><span class="hs-identifier hs-var">pprNameProvenance</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681108775"><span class="hs-identifier hs-var">gres'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-162"></span><span>        </span><span class="hs-keyword">where</span><span>
</span><span id="line-163"></span><span>          </span><span class="hs-special">(</span><span id="local-6989586621681108770"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681108770"><span class="hs-identifier hs-var">loc</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681108782"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681108782"><span class="hs-identifier hs-var">occ</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; (SrcSpan, OccName)
</span><a href="#local-6989586621681108791"><span class="hs-identifier hs-var">get_loc_occ</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681108784"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-164"></span><span>          </span><span id="local-6989586621681108780"><span class="annot"><span class="annottext">mb_local :: Maybe Name
</span><a href="#local-6989586621681108780"><span class="hs-identifier hs-var hs-var">mb_local</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LocalRdrEnv -&gt; OccName -&gt; Maybe Name
</span><a href="GHC.Types.Name.Reader.html#lookupLocalRdrOcc"><span class="hs-identifier hs-var">lookupLocalRdrOcc</span></a></span><span> </span><span class="annot"><span class="annottext">LocalRdrEnv
</span><a href="#local-6989586621681108792"><span class="hs-identifier hs-var">local_env</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681108782"><span class="hs-identifier hs-var">occ</span></a></span><span>
</span><span id="line-165"></span><span>          </span><span id="local-6989586621681108772"><span class="annot"><span class="annottext">gres :: [GlobalRdrElt]
</span><a href="#local-6989586621681108772"><span class="hs-identifier hs-var hs-var">gres</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; GlobalRdrEnv -&gt; [GlobalRdrElt]
</span><a href="GHC.Types.Name.Reader.html#lookupGRE_RdrName"><span class="hs-identifier hs-var">lookupGRE_RdrName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; RdrName
</span><a href="GHC.Types.Name.Reader.html#mkRdrUnqual"><span class="hs-identifier hs-var">mkRdrUnqual</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681108782"><span class="hs-identifier hs-var">occ</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681108793"><span class="hs-identifier hs-var">global_env</span></a></span><span>
</span><span id="line-166"></span><span>                </span><span class="hs-comment">-- Make an Unqualified RdrName and look that up, so that</span><span>
</span><span id="line-167"></span><span>                </span><span class="hs-comment">-- we don't find any GREs that are in scope qualified-only</span><span>
</span><span id="line-168"></span><span>
</span><span id="line-169"></span><span>          </span><span id="local-6989586621681108779"><span class="annot"><span class="annottext">complain :: [MsgDoc] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="#local-6989586621681108779"><span class="hs-identifier hs-var hs-var">complain</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-170"></span><span>          </span><span class="annot"><a href="#local-6989586621681108779"><span class="hs-identifier hs-var">complain</span></a></span><span> </span><span id="local-6989586621681108766"><span class="annot"><span class="annottext">[MsgDoc]
</span><a href="#local-6989586621681108766"><span class="hs-identifier hs-var">pp_locs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WarnReason -&gt; SrcSpan -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#addWarnAt"><span class="hs-identifier hs-var">addWarnAt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WarningFlag -&gt; WarnReason
</span><a href="GHC.Driver.Flags.html#Reason"><span class="hs-identifier hs-var">Reason</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnNameShadowing"><span class="hs-identifier hs-var">Opt_WarnNameShadowing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-171"></span><span>                                       </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681108770"><span class="hs-identifier hs-var">loc</span></a></span><span>
</span><span id="line-172"></span><span>                                       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; [MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Rename.Utils.html#shadowedNameWarn"><span class="hs-identifier hs-var">shadowedNameWarn</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681108782"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">[MsgDoc]
</span><a href="#local-6989586621681108766"><span class="hs-identifier hs-var">pp_locs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-173"></span><span>
</span><span id="line-174"></span><span>    </span><span class="annot"><a href="#local-6989586621681108773"><span class="hs-identifier hs-type">is_shadowed_gre</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrElt"><span class="hs-identifier hs-type">GlobalRdrElt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-175"></span><span>        </span><span class="hs-comment">-- Returns False for record selectors that are shadowed, when</span><span>
</span><span id="line-176"></span><span>        </span><span class="hs-comment">-- punning or wild-cards are on (cf #2723)</span><span>
</span><span id="line-177"></span><span>    </span><span id="local-6989586621681108773"><span class="annot"><span class="annottext">is_shadowed_gre :: GlobalRdrElt -&gt; IOEnv (Env TcGblEnv TcLclEnv) Bool
</span><a href="#local-6989586621681108773"><span class="hs-identifier hs-var hs-var">is_shadowed_gre</span></a></span></span><span> </span><span id="local-6989586621681108762"><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681108762"><span class="hs-identifier hs-var">gre</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; Bool
</span><a href="GHC.Types.Name.Reader.html#isRecFldGRE"><span class="hs-identifier hs-var">isRecFldGRE</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681108762"><span class="hs-identifier hs-var">gre</span></a></span><span>
</span><span id="line-178"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681108760"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681108760"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-179"></span><span>             </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; IOEnv (Env TcGblEnv TcLclEnv) Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; IOEnv (Env TcGblEnv TcLclEnv) Bool)
-&gt; Bool -&gt; IOEnv (Env TcGblEnv TcLclEnv) Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Extension -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#xopt"><span class="hs-identifier hs-var">xopt</span></a></span><span> </span><span class="annot"><span class="annottext">Extension
</span><a href="../../ghc-boot-th/src/GHC.LanguageExtensions.Type.html#RecordPuns"><span class="hs-identifier hs-var">LangExt.RecordPuns</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681108760"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-180"></span><span>                             </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Extension -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#xopt"><span class="hs-identifier hs-var">xopt</span></a></span><span> </span><span class="annot"><span class="annottext">Extension
</span><a href="../../ghc-boot-th/src/GHC.LanguageExtensions.Type.html#RecordWildCards"><span class="hs-identifier hs-var">LangExt.RecordWildCards</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681108760"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-181"></span><span>    </span><span class="annot"><a href="#local-6989586621681108773"><span class="hs-identifier hs-var">is_shadowed_gre</span></a></span><span> </span><span id="local-6989586621681108753"><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681108753"><span class="hs-identifier hs-var">_other</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; IOEnv (Env TcGblEnv TcLclEnv) Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-182"></span><span>
</span><span id="line-183"></span><span class="hs-comment">-------------------------------------</span><span>
</span><span id="line-184"></span><span class="hs-comment">-- | Throw an error message if a user attempts to quantify an inferred type</span><span>
</span><span id="line-185"></span><span class="hs-comment">-- variable in a place where specificity cannot be observed. For example,</span><span>
</span><span id="line-186"></span><span class="hs-comment">-- @forall {a}. [a] -&gt; [a]@ would be rejected to the inferred type variable</span><span>
</span><span id="line-187"></span><span class="hs-comment">-- @{a}@, but @forall a. [a] -&gt; [a]@ would be accepted.</span><span>
</span><span id="line-188"></span><span class="hs-comment">-- See @Note [Unobservably inferred type variables]@.</span><span>
</span><span id="line-189"></span><span class="annot"><a href="GHC.Rename.Utils.html#checkInferredVars"><span class="hs-identifier hs-type">checkInferredVars</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#HsDocContext"><span class="hs-identifier hs-type">HsDocContext</span></a></span><span>
</span><span id="line-190"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-191"></span><span>                  </span><span class="hs-comment">-- ^ The error msg if the signature is not allowed to contain</span><span>
</span><span id="line-192"></span><span>                  </span><span class="hs-comment">--   manually written inferred variables.</span><span>
</span><span id="line-193"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Type.html#LHsSigType"><span class="hs-identifier hs-type">LHsSigType</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span>
</span><span id="line-194"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-195"></span><span id="checkInferredVars"><span class="annot"><span class="annottext">checkInferredVars :: HsDocContext
-&gt; Maybe MsgDoc
-&gt; LHsSigType GhcPs
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#checkInferredVars"><span class="hs-identifier hs-var hs-var">checkInferredVars</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsDocContext
</span><span class="hs-identifier">_</span></span><span>    </span><span class="annot"><span class="annottext">Maybe MsgDoc
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>    </span><span class="annot"><span class="annottext">LHsSigType GhcPs
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-196"></span><span class="annot"><a href="GHC.Rename.Utils.html#checkInferredVars"><span class="hs-identifier hs-var">checkInferredVars</span></a></span><span> </span><span id="local-6989586621681108751"><span class="annot"><span class="annottext">HsDocContext
</span><a href="#local-6989586621681108751"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681108750"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108750"><span class="hs-identifier hs-var">msg</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681108749"><span class="annot"><span class="annottext">LHsSigType GhcPs
</span><a href="#local-6989586621681108749"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-197"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681108748"><span class="annot"><span class="annottext">bndrs :: [HsTyVarBndr Specificity GhcPs]
</span><a href="#local-6989586621681108748"><span class="hs-identifier hs-var hs-var">bndrs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsType GhcPs -&gt; [HsTyVarBndr Specificity GhcPs]
</span><a href="#local-6989586621681108747"><span class="hs-identifier hs-var">forallty_bndrs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsSigType GhcPs -&gt; LHsType GhcPs
forall (p :: Pass). LHsSigType (GhcPass p) -&gt; LHsType (GhcPass p)
</span><a href="GHC.Hs.Type.html#hsSigType"><span class="hs-identifier hs-var">hsSigType</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigType GhcPs
</span><a href="#local-6989586621681108749"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-198"></span><span>  </span><span class="hs-keyword">in</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">(HsTyVarBndr Specificity GhcPs -&gt; Bool)
-&gt; [HsTyVarBndr Specificity GhcPs]
-&gt; Maybe (HsTyVarBndr Specificity GhcPs)
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Maybe a
</span><a href="../../base/src/Data.Foldable.html#find"><span class="hs-identifier hs-var">find</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Specificity -&gt; Specificity -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">(==)</span></span><span> </span><span class="annot"><span class="annottext">Specificity
</span><a href="GHC.Types.Var.html#InferredSpec"><span class="hs-identifier hs-var">InferredSpec</span></a></span><span> </span><span class="annot"><span class="annottext">(Specificity -&gt; Bool)
-&gt; (HsTyVarBndr Specificity GhcPs -&gt; Specificity)
-&gt; HsTyVarBndr Specificity GhcPs
-&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">HsTyVarBndr Specificity GhcPs -&gt; Specificity
forall flag (pass :: Pass). HsTyVarBndr flag (GhcPass pass) -&gt; flag
</span><a href="GHC.Hs.Type.html#hsTyVarBndrFlag"><span class="hs-identifier hs-var">hsTyVarBndrFlag</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[HsTyVarBndr Specificity GhcPs]
</span><a href="#local-6989586621681108748"><span class="hs-identifier hs-var">bndrs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-199"></span><span>    </span><span class="annot"><span class="annottext">Maybe (HsTyVarBndr Specificity GhcPs)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-200"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">HsTyVarBndr Specificity GhcPs
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#addErr"><span class="hs-identifier hs-var">addErr</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Rename.Utils.html#withHsDocContext"><span class="hs-identifier hs-var">withHsDocContext</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext
</span><a href="#local-6989586621681108751"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108750"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-201"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-202"></span><span>    </span><span class="annot"><a href="#local-6989586621681108747"><span class="hs-identifier hs-type">forallty_bndrs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Type.html#LHsType"><span class="hs-identifier hs-type">LHsType</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Type.html#HsTyVarBndr"><span class="hs-identifier hs-type">HsTyVarBndr</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Specificity"><span class="hs-identifier hs-type">Specificity</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-203"></span><span>    </span><span id="local-6989586621681108747"><span class="annot"><span class="annottext">forallty_bndrs :: LHsType GhcPs -&gt; [HsTyVarBndr Specificity GhcPs]
</span><a href="#local-6989586621681108747"><span class="hs-identifier hs-var hs-var">forallty_bndrs</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681108741"><span class="annot"><span class="annottext">HsType GhcPs
</span><a href="#local-6989586621681108741"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HsType GhcPs
</span><a href="#local-6989586621681108741"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-204"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsParTy"><span class="hs-identifier hs-type">HsParTy</span></a></span><span> </span><span class="annot"><span class="annottext">XParTy GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681108739"><span class="annot"><span class="annottext">LHsType GhcPs
</span><a href="#local-6989586621681108739"><span class="hs-identifier hs-var">ty'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LHsType GhcPs -&gt; [HsTyVarBndr Specificity GhcPs]
</span><a href="#local-6989586621681108747"><span class="hs-identifier hs-var">forallty_bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">LHsType GhcPs
</span><a href="#local-6989586621681108739"><span class="hs-identifier hs-var">ty'</span></a></span><span>
</span><span id="line-205"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsForAllTy"><span class="hs-identifier hs-type">HsForAllTy</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hst_tele :: forall pass. HsType pass -&gt; HsForAllTelescope pass
</span><a href="GHC.Hs.Type.html#hst_tele"><span class="hs-identifier hs-var">hst_tele</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Hs.Type.html#HsForAllInvis"><span class="hs-identifier hs-type">HsForAllInvis</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsf_invis_bndrs :: forall pass.
HsForAllTelescope pass -&gt; [LHsTyVarBndr Specificity pass]
</span><a href="GHC.Hs.Type.html#hsf_invis_bndrs"><span class="hs-identifier hs-var">hsf_invis_bndrs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681108734"><span class="annot"><span class="annottext">[LHsTyVarBndr Specificity GhcPs]
</span><a href="#local-6989586621681108734"><span class="hs-identifier hs-var">tvs</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-206"></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(LHsTyVarBndr Specificity GhcPs -&gt; HsTyVarBndr Specificity GhcPs)
-&gt; [LHsTyVarBndr Specificity GhcPs]
-&gt; [HsTyVarBndr Specificity GhcPs]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">LHsTyVarBndr Specificity GhcPs -&gt; HsTyVarBndr Specificity GhcPs
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsTyVarBndr Specificity GhcPs]
</span><a href="#local-6989586621681108734"><span class="hs-identifier hs-var">tvs</span></a></span><span>
</span><span id="line-207"></span><span>      </span><span class="annot"><span class="annottext">HsType GhcPs
</span><span class="hs-identifier">_</span></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-208"></span><span>
</span><span id="line-209"></span><span class="hs-comment">{-
Note [Unobservably inferred type variables]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
While GHC's parser allows the use of inferred type variables
(e.g., `forall {a}. &lt;...&gt;`) just about anywhere that type variable binders can
appear, there are some situations where the distinction between inferred and
specified type variables cannot be observed. For example, consider this
instance declaration:

  instance forall {a}. Eq (T a) where ...

Making {a} inferred is pointless, as there is no way for user code to
&quot;apply&quot; an instance declaration in a way where the inferred/specified
distinction would make a difference. (Notably, there is no opportunity
for visible type application of an instance declaration.) Anyone who
writes such code is likely confused, so in an attempt to be helpful,
we emit an error message if a user writes code like this. The
checkInferredVars function is responsible for implementing this
restriction.

It turns out to be somewhat cumbersome to enforce this restriction in
certain cases.  Specifically:

* Quantified constraints. In the type `f :: (forall {a}. C a) =&gt; Proxy Int`,
  there is no way to observe that {a} is inferred. Nevertheless, actually
  rejecting this code would be tricky, as we would need to reject
  `forall {a}. &lt;...&gt;` as a constraint but *accept* other uses of
  `forall {a}. &lt;...&gt;` as a type (e.g., `g :: (forall {a}. a -&gt; a) -&gt; b -&gt; b`).
  This is quite tedious to do in practice, so we don't bother.

* Default method type signatures (#18432). These are tricky because inferred
  type variables can appear nested, e.g.,

    class C a where
      m         :: forall b. a -&gt; b -&gt; forall c.   c -&gt; c
      default m :: forall b. a -&gt; b -&gt; forall {c}. c -&gt; c
      m _ _ = id

  Robustly checking for nested, inferred type variables ends up being a pain,
  so we don't try to do this.

For now, we simply allow inferred quantifiers to be specified here,
even though doing so is pointless. All we lose is a warning.

Aside from the places where we already use checkInferredVars, most of
the other places where inferred vars don't make sense are in any case
already prohibited from having foralls /at all/.  For example:

  instance forall a. forall {b}. Eq (Either a b) where ...

Here the nested `forall {b}` is already prohibited. (See
Note [No nested foralls or contexts in instance types] in GHC.Hs.Type).
-}</span><span>
</span><span id="line-262"></span><span>
</span><span id="line-263"></span><span class="hs-comment">-- | Examines a non-outermost type for @forall@s or contexts, which are assumed</span><span>
</span><span id="line-264"></span><span class="hs-comment">-- to be nested. For example, in the following declaration:</span><span>
</span><span id="line-265"></span><span class="hs-comment">--</span><span>
</span><span id="line-266"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-267"></span><span class="hs-comment">-- instance forall a. forall b. C (Either a b)</span><span>
</span><span id="line-268"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-269"></span><span class="hs-comment">--</span><span>
</span><span id="line-270"></span><span class="hs-comment">-- The outermost @forall a@ is fine, but the nested @forall b@ is not. We</span><span>
</span><span id="line-271"></span><span class="hs-comment">-- invoke 'noNestedForallsContextsErr' on the type @forall b. C (Either a b)@</span><span>
</span><span id="line-272"></span><span class="hs-comment">-- to catch the nested @forall@ and create a suitable error message.</span><span>
</span><span id="line-273"></span><span class="hs-comment">-- 'noNestedForallsContextsErr' returns @'Just' err_msg@ if such a @forall@ or</span><span>
</span><span id="line-274"></span><span class="hs-comment">-- context is found, and returns @Nothing@ otherwise.</span><span>
</span><span id="line-275"></span><span class="hs-comment">--</span><span>
</span><span id="line-276"></span><span class="hs-comment">-- This is currently used in the following places:</span><span>
</span><span id="line-277"></span><span class="hs-comment">--</span><span>
</span><span id="line-278"></span><span class="hs-comment">-- * In GADT constructor types (in 'rnConDecl').</span><span>
</span><span id="line-279"></span><span class="hs-comment">--   See @Note [GADT abstract syntax] (Wrinkle: No nested foralls or contexts)@</span><span>
</span><span id="line-280"></span><span class="hs-comment">--   in &quot;GHC.Hs.Type&quot;.</span><span>
</span><span id="line-281"></span><span class="hs-comment">--</span><span>
</span><span id="line-282"></span><span class="hs-comment">-- * In instance declaration types (in 'rnClsIntDecl' and 'rnSrcDerivDecl' in</span><span>
</span><span id="line-283"></span><span class="hs-comment">--   &quot;GHC.Rename.Module&quot; and 'renameSig' in &quot;GHC.Rename.Bind&quot;).</span><span>
</span><span id="line-284"></span><span class="hs-comment">--   See @Note [No nested foralls or contexts in instance types]@ in</span><span>
</span><span id="line-285"></span><span class="hs-comment">--   &quot;GHC.Hs.Type&quot;.</span><span>
</span><span id="line-286"></span><span class="annot"><a href="GHC.Rename.Utils.html#noNestedForallsContextsErr"><span class="hs-identifier hs-type">noNestedForallsContextsErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Type.html#LHsType"><span class="hs-identifier hs-type">LHsType</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-287"></span><span id="noNestedForallsContextsErr"><span class="annot"><span class="annottext">noNestedForallsContextsErr :: MsgDoc -&gt; LHsType GhcRn -&gt; Maybe (SrcSpan, MsgDoc)
</span><a href="GHC.Rename.Utils.html#noNestedForallsContextsErr"><span class="hs-identifier hs-var hs-var">noNestedForallsContextsErr</span></a></span></span><span> </span><span id="local-6989586621681108733"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108733"><span class="hs-identifier hs-var">what</span></a></span></span><span> </span><span id="local-6989586621681108732"><span class="annot"><span class="annottext">LHsType GhcRn
</span><a href="#local-6989586621681108732"><span class="hs-identifier hs-var">lty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-288"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">LHsType GhcRn -&gt; LHsType GhcRn
forall pass. LHsType pass -&gt; LHsType pass
</span><a href="GHC.Hs.Type.html#ignoreParens"><span class="hs-identifier hs-var">ignoreParens</span></a></span><span> </span><span class="annot"><span class="annottext">LHsType GhcRn
</span><a href="#local-6989586621681108732"><span class="hs-identifier hs-var">lty</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-289"></span><span>    </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681108730"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681108730"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Type.html#HsForAllTy"><span class="hs-identifier hs-type">HsForAllTy</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hst_tele :: forall pass. HsType pass -&gt; HsForAllTelescope pass
</span><a href="GHC.Hs.Type.html#hst_tele"><span class="hs-identifier hs-var">hst_tele</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681108729"><span class="annot"><span class="annottext">HsForAllTelescope GhcRn
</span><a href="#local-6989586621681108729"><span class="hs-identifier hs-var">tele</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-290"></span><span>      </span><span class="hs-glyph">|</span><span>  </span><span class="annot"><a href="GHC.Hs.Type.html#HsForAllVis"><span class="hs-identifier hs-type">HsForAllVis</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsForAllTelescope GhcRn
</span><a href="#local-6989586621681108729"><span class="hs-identifier hs-var">tele</span></a></span><span>
</span><span id="line-291"></span><span>         </span><span class="hs-comment">-- The only two places where this function is called correspond to</span><span>
</span><span id="line-292"></span><span>         </span><span class="hs-comment">-- types of terms, so we give a slightly more descriptive error</span><span>
</span><span id="line-293"></span><span>         </span><span class="hs-comment">-- message in the event that they contain visible dependent</span><span>
</span><span id="line-294"></span><span>         </span><span class="hs-comment">-- quantification (currently only allowed in kinds).</span><span>
</span><span id="line-295"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(SrcSpan, MsgDoc) -&gt; Maybe (SrcSpan, MsgDoc)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681108730"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Illegal visible, dependent quantification&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-296"></span><span>                         </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;in the type of a term&quot;</span></span><span>
</span><span id="line-297"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;(GHC does not yet support this)&quot;</span></span><span> </span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-298"></span><span>      </span><span class="hs-glyph">|</span><span>  </span><span class="annot"><a href="GHC.Hs.Type.html#HsForAllInvis"><span class="hs-identifier hs-type">HsForAllInvis</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsForAllTelescope GhcRn
</span><a href="#local-6989586621681108729"><span class="hs-identifier hs-var">tele</span></a></span><span>
</span><span id="line-299"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(SrcSpan, MsgDoc) -&gt; Maybe (SrcSpan, MsgDoc)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681108730"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108726"><span class="hs-identifier hs-var">nested_foralls_contexts_err</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-300"></span><span>    </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681108725"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681108725"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Type.html#HsQualTy"><span class="hs-identifier hs-type">HsQualTy</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-301"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(SrcSpan, MsgDoc) -&gt; Maybe (SrcSpan, MsgDoc)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681108725"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108726"><span class="hs-identifier hs-var">nested_foralls_contexts_err</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-302"></span><span>    </span><span class="annot"><span class="annottext">LHsType GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe (SrcSpan, MsgDoc)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-303"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-304"></span><span>    </span><span id="local-6989586621681108726"><span class="annot"><span class="annottext">nested_foralls_contexts_err :: MsgDoc
</span><a href="#local-6989586621681108726"><span class="hs-identifier hs-var hs-var">nested_foralls_contexts_err</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-305"></span><span>      </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108733"><span class="hs-identifier hs-var">what</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;cannot contain nested&quot;</span></span><span>
</span><span id="line-306"></span><span>      </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#forAllLit"><span class="hs-identifier hs-var">forAllLit</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;s or contexts&quot;</span></span><span>
</span><span id="line-307"></span><span>
</span><span id="line-308"></span><span class="hs-comment">-- | A common way to invoke 'noNestedForallsContextsErr'.</span><span>
</span><span id="line-309"></span><span class="annot"><a href="GHC.Rename.Utils.html#addNoNestedForallsContextsErr"><span class="hs-identifier hs-type">addNoNestedForallsContextsErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#HsDocContext"><span class="hs-identifier hs-type">HsDocContext</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Type.html#LHsType"><span class="hs-identifier hs-type">LHsType</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-310"></span><span id="addNoNestedForallsContextsErr"><span class="annot"><span class="annottext">addNoNestedForallsContextsErr :: HsDocContext
-&gt; MsgDoc -&gt; LHsType GhcRn -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#addNoNestedForallsContextsErr"><span class="hs-identifier hs-var hs-var">addNoNestedForallsContextsErr</span></a></span></span><span> </span><span id="local-6989586621681108720"><span class="annot"><span class="annottext">HsDocContext
</span><a href="#local-6989586621681108720"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681108719"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108719"><span class="hs-identifier hs-var">what</span></a></span></span><span> </span><span id="local-6989586621681108718"><span class="annot"><span class="annottext">LHsType GhcRn
</span><a href="#local-6989586621681108718"><span class="hs-identifier hs-var">lty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-311"></span><span>  </span><span class="annot"><span class="annottext">Maybe (SrcSpan, MsgDoc)
-&gt; ((SrcSpan, MsgDoc) -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (m :: * -&gt; *) a. Monad m =&gt; Maybe a -&gt; (a -&gt; m ()) -&gt; m ()
</span><a href="GHC.Data.Maybe.html#whenIsJust"><span class="hs-identifier hs-var">whenIsJust</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MsgDoc -&gt; LHsType GhcRn -&gt; Maybe (SrcSpan, MsgDoc)
</span><a href="GHC.Rename.Utils.html#noNestedForallsContextsErr"><span class="hs-identifier hs-var">noNestedForallsContextsErr</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108719"><span class="hs-identifier hs-var">what</span></a></span><span> </span><span class="annot"><span class="annottext">LHsType GhcRn
</span><a href="#local-6989586621681108718"><span class="hs-identifier hs-var">lty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(((SrcSpan, MsgDoc) -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; ((SrcSpan, MsgDoc) -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621681108717"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681108717"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681108716"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108716"><span class="hs-identifier hs-var">err_msg</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-312"></span><span>    </span><span class="annot"><span class="annottext">SrcSpan -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#addErrAt"><span class="hs-identifier hs-var">addErrAt</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681108717"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Rename.Utils.html#withHsDocContext"><span class="hs-identifier hs-var">withHsDocContext</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext
</span><a href="#local-6989586621681108720"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108716"><span class="hs-identifier hs-var">err_msg</span></a></span><span>
</span><span id="line-313"></span><span>
</span><span id="line-314"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{Free variable manipulation}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-321"></span><span>
</span><span id="line-322"></span><span class="hs-comment">-- A useful utility</span><span>
</span><span id="line-323"></span><span id="local-6989586621681109055"><span class="annot"><a href="GHC.Rename.Utils.html#addFvRn"><span class="hs-identifier hs-type">addFvRn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681109055"><span class="hs-identifier hs-type">thing</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681109055"><span class="hs-identifier hs-type">thing</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-324"></span><span id="addFvRn"><span class="annot"><span class="annottext">addFvRn :: forall thing.
FreeVars -&gt; RnM (thing, FreeVars) -&gt; RnM (thing, FreeVars)
</span><a href="GHC.Rename.Utils.html#addFvRn"><span class="hs-identifier hs-var hs-var">addFvRn</span></a></span></span><span> </span><span id="local-6989586621681108713"><span class="annot"><span class="annottext">FreeVars
</span><a href="#local-6989586621681108713"><span class="hs-identifier hs-var">fvs1</span></a></span></span><span> </span><span id="local-6989586621681108712"><span class="annot"><span class="annottext">RnM (thing, FreeVars)
</span><a href="#local-6989586621681108712"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681108711"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681108711"><span class="hs-identifier hs-var">res</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681108710"><span class="annot"><span class="annottext">FreeVars
</span><a href="#local-6989586621681108710"><span class="hs-identifier hs-var">fvs2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RnM (thing, FreeVars)
</span><a href="#local-6989586621681108712"><span class="hs-identifier hs-var">thing_inside</span></a></span><span>
</span><span id="line-325"></span><span>                               </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(thing, FreeVars) -&gt; RnM (thing, FreeVars)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681108711"><span class="hs-identifier hs-var">res</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FreeVars
</span><a href="#local-6989586621681108713"><span class="hs-identifier hs-var">fvs1</span></a></span><span> </span><span class="annot"><span class="annottext">FreeVars -&gt; FreeVars -&gt; FreeVars
</span><a href="GHC.Types.Name.Set.html#plusFV"><span class="hs-operator hs-var">`plusFV`</span></a></span><span> </span><span class="annot"><span class="annottext">FreeVars
</span><a href="#local-6989586621681108710"><span class="hs-identifier hs-var">fvs2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-326"></span><span>
</span><span id="line-327"></span><span id="local-6989586621681109052"><span id="local-6989586621681109053"><span class="annot"><a href="GHC.Rename.Utils.html#mapFvRn"><span class="hs-identifier hs-type">mapFvRn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681109053"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681109052"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621681109053"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621681109052"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-328"></span><span id="mapFvRn"><span class="annot"><span class="annottext">mapFvRn :: forall a b. (a -&gt; RnM (b, FreeVars)) -&gt; [a] -&gt; RnM ([b], FreeVars)
</span><a href="GHC.Rename.Utils.html#mapFvRn"><span class="hs-identifier hs-var hs-var">mapFvRn</span></a></span></span><span> </span><span id="local-6989586621681108704"><span class="annot"><span class="annottext">a -&gt; RnM (b, FreeVars)
</span><a href="#local-6989586621681108704"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621681108703"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681108703"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681108702"><span class="annot"><span class="annottext">[(b, FreeVars)]
</span><a href="#local-6989586621681108702"><span class="hs-identifier hs-var">stuff</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(a -&gt; RnM (b, FreeVars))
-&gt; [a] -&gt; IOEnv (Env TcGblEnv TcLclEnv) [(b, FreeVars)]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; RnM (b, FreeVars)
</span><a href="#local-6989586621681108704"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681108703"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-329"></span><span>                  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[(b, FreeVars)] -&gt; ([b], [FreeVars])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span> </span><span class="annot"><span class="annottext">[(b, FreeVars)]
</span><a href="#local-6989586621681108702"><span class="hs-identifier hs-var">stuff</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-330"></span><span>                      </span><span class="hs-special">(</span><span id="local-6989586621681108700"><span class="annot"><span class="annottext">[b]
</span><a href="#local-6989586621681108700"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681108699"><span class="annot"><span class="annottext">[FreeVars]
</span><a href="#local-6989586621681108699"><span class="hs-identifier hs-var">fvs_s</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">([b], FreeVars) -&gt; RnM ([b], FreeVars)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[b]
</span><a href="#local-6989586621681108700"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[FreeVars] -&gt; FreeVars
</span><a href="GHC.Types.Name.Set.html#plusFVs"><span class="hs-identifier hs-var">plusFVs</span></a></span><span> </span><span class="annot"><span class="annottext">[FreeVars]
</span><a href="#local-6989586621681108699"><span class="hs-identifier hs-var">fvs_s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-331"></span><span>
</span><span id="line-332"></span><span id="local-6989586621681109046"><span id="local-6989586621681109047"><span class="annot"><a href="GHC.Rename.Utils.html#mapMaybeFvRn"><span class="hs-identifier hs-type">mapMaybeFvRn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681109047"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681109046"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681109047"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681109046"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-333"></span><span id="mapMaybeFvRn"><span class="annot"><span class="annottext">mapMaybeFvRn :: forall a b.
(a -&gt; RnM (b, FreeVars)) -&gt; Maybe a -&gt; RnM (Maybe b, FreeVars)
</span><a href="GHC.Rename.Utils.html#mapMaybeFvRn"><span class="hs-identifier hs-var hs-var">mapMaybeFvRn</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; RnM (b, FreeVars)
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Maybe b, FreeVars)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe b, FreeVars)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe b
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FreeVars
</span><a href="GHC.Types.Name.Set.html#emptyFVs"><span class="hs-identifier hs-var">emptyFVs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-334"></span><span class="annot"><a href="GHC.Rename.Utils.html#mapMaybeFvRn"><span class="hs-identifier hs-var">mapMaybeFvRn</span></a></span><span> </span><span id="local-6989586621681108693"><span class="annot"><span class="annottext">a -&gt; RnM (b, FreeVars)
</span><a href="#local-6989586621681108693"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681108692"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681108692"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681108691"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621681108691"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681108690"><span class="annot"><span class="annottext">FreeVars
</span><a href="#local-6989586621681108690"><span class="hs-identifier hs-var">fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">a -&gt; RnM (b, FreeVars)
</span><a href="#local-6989586621681108693"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681108692"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Maybe b, FreeVars)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe b, FreeVars)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; Maybe b
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621681108691"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FreeVars
</span><a href="#local-6989586621681108690"><span class="hs-identifier hs-var">fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-335"></span><span>
</span><span id="line-336"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{Envt utility functions}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-343"></span><span>
</span><span id="line-344"></span><span class="annot"><a href="GHC.Rename.Utils.html#warnUnusedTopBinds"><span class="hs-identifier hs-type">warnUnusedTopBinds</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrElt"><span class="hs-identifier hs-type">GlobalRdrElt</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-345"></span><span id="warnUnusedTopBinds"><span class="annot"><span class="annottext">warnUnusedTopBinds :: [GlobalRdrElt] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#warnUnusedTopBinds"><span class="hs-identifier hs-var hs-var">warnUnusedTopBinds</span></a></span></span><span> </span><span id="local-6989586621681108689"><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681108689"><span class="hs-identifier hs-var">gres</span></a></span></span><span>
</span><span id="line-346"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WarningFlag
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall gbl lcl.
WarningFlag -&gt; TcRnIf gbl lcl () -&gt; TcRnIf gbl lcl ()
</span><a href="GHC.Tc.Utils.Monad.html#whenWOptM"><span class="hs-identifier hs-var">whenWOptM</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnUnusedTopBinds"><span class="hs-identifier hs-var">Opt_WarnUnusedTopBinds</span></a></span><span>
</span><span id="line-347"></span><span>    </span><span class="annot"><span class="annottext">(IOEnv (Env TcGblEnv TcLclEnv) ()
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681108687"><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681108687"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf TcGblEnv TcLclEnv TcGblEnv
forall gbl lcl. TcRnIf gbl lcl gbl
</span><a href="GHC.Tc.Utils.Monad.html#getGblEnv"><span class="hs-identifier hs-var">getGblEnv</span></a></span><span>
</span><span id="line-348"></span><span>         </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681108685"><span class="annot"><span class="annottext">isBoot :: Bool
</span><a href="#local-6989586621681108685"><span class="hs-identifier hs-var hs-var">isBoot</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcGblEnv -&gt; HscSource
</span><a href="GHC.Tc.Types.html#tcg_src"><span class="hs-identifier hs-var hs-var">tcg_src</span></a></span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681108687"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">HscSource -&gt; HscSource -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">HscSource
</span><a href="GHC.Driver.Phases.html#HsBootFile"><span class="hs-identifier hs-var">HsBootFile</span></a></span><span>
</span><span id="line-349"></span><span>         </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681108682"><span class="annot"><span class="annottext">noParent :: GlobalRdrElt -&gt; Bool
</span><a href="#local-6989586621681108682"><span class="hs-identifier hs-var hs-var">noParent</span></a></span></span><span> </span><span id="local-6989586621681108681"><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681108681"><span class="hs-identifier hs-var">gre</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; Parent
</span><a href="GHC.Types.Name.Reader.html#gre_par"><span class="hs-identifier hs-var hs-var">gre_par</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681108681"><span class="hs-identifier hs-var">gre</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-350"></span><span>                            </span><span class="annot"><span class="annottext">Parent
</span><a href="GHC.Types.Name.Reader.html#NoParent"><span class="hs-identifier hs-var">NoParent</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-351"></span><span>                            </span><span class="annot"><span class="annottext">Parent
</span><span class="hs-identifier">_</span></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-352"></span><span>             </span><span class="hs-comment">-- Don't warn about unused bindings with parents in</span><span>
</span><span id="line-353"></span><span>             </span><span class="hs-comment">-- .hs-boot files, as you are sometimes required to give</span><span>
</span><span id="line-354"></span><span>             </span><span class="hs-comment">-- unused bindings (trac #3449).</span><span>
</span><span id="line-355"></span><span>             </span><span class="hs-comment">-- HOWEVER, in a signature file, you are never obligated to put a</span><span>
</span><span id="line-356"></span><span>             </span><span class="hs-comment">-- definition in the main text.  Thus, if you define something</span><span>
</span><span id="line-357"></span><span>             </span><span class="hs-comment">-- and forget to export it, we really DO want to warn.</span><span>
</span><span id="line-358"></span><span>             </span><span id="local-6989586621681108678"><span class="annot"><span class="annottext">gres' :: [GlobalRdrElt]
</span><a href="#local-6989586621681108678"><span class="hs-identifier hs-var hs-var">gres'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681108685"><span class="hs-identifier hs-var">isBoot</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">(GlobalRdrElt -&gt; Bool) -&gt; [GlobalRdrElt] -&gt; [GlobalRdrElt]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; Bool
</span><a href="#local-6989586621681108682"><span class="hs-identifier hs-var">noParent</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681108689"><span class="hs-identifier hs-var">gres</span></a></span><span>
</span><span id="line-359"></span><span>                               </span><span class="hs-keyword">else</span><span>                 </span><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681108689"><span class="hs-identifier hs-var">gres</span></a></span><span>
</span><span id="line-360"></span><span>         </span><span class="annot"><span class="annottext">[GlobalRdrElt] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#warnUnusedGREs"><span class="hs-identifier hs-var">warnUnusedGREs</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681108678"><span class="hs-identifier hs-var">gres'</span></a></span><span>
</span><span id="line-361"></span><span>
</span><span id="line-362"></span><span>
</span><span id="line-363"></span><span class="hs-comment">-- | Checks to see if we need to warn for -Wunused-record-wildcards or</span><span>
</span><span id="line-364"></span><span class="hs-comment">-- -Wredundant-record-wildcards</span><span>
</span><span id="line-365"></span><span class="annot"><a href="GHC.Rename.Utils.html#checkUnusedRecordWildcard"><span class="hs-identifier hs-type">checkUnusedRecordWildcard</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span>
</span><span id="line-366"></span><span>                          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span>
</span><span id="line-367"></span><span>                          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-368"></span><span>                          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-369"></span><span id="checkUnusedRecordWildcard"><span class="annot"><span class="annottext">checkUnusedRecordWildcard :: SrcSpan
-&gt; FreeVars -&gt; Maybe [Name] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#checkUnusedRecordWildcard"><span class="hs-identifier hs-var hs-var">checkUnusedRecordWildcard</span></a></span></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">FreeVars
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Maybe [Name]
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-370"></span><span class="annot"><a href="GHC.Rename.Utils.html#checkUnusedRecordWildcard"><span class="hs-identifier hs-var">checkUnusedRecordWildcard</span></a></span><span> </span><span id="local-6989586621681108676"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681108676"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="annot"><span class="annottext">FreeVars
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-371"></span><span>  </span><span class="hs-comment">-- Add a new warning if the .. pattern binds no variables</span><span>
</span><span id="line-372"></span><span>  </span><span class="annot"><span class="annottext">SrcSpan
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a. SrcSpan -&gt; TcRn a -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#setSrcSpan"><span class="hs-identifier hs-var">setSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681108676"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env TcGblEnv TcLclEnv) ()
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#warnRedundantRecordWildcard"><span class="hs-identifier hs-var">warnRedundantRecordWildcard</span></a></span><span>
</span><span id="line-373"></span><span class="annot"><a href="GHC.Rename.Utils.html#checkUnusedRecordWildcard"><span class="hs-identifier hs-var">checkUnusedRecordWildcard</span></a></span><span> </span><span id="local-6989586621681108673"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681108673"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681108672"><span class="annot"><span class="annottext">FreeVars
</span><a href="#local-6989586621681108672"><span class="hs-identifier hs-var">fvs</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681108671"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108671"><span class="hs-identifier hs-var">dotdot_names</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-374"></span><span>  </span><span class="annot"><span class="annottext">SrcSpan
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a. SrcSpan -&gt; TcRn a -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#setSrcSpan"><span class="hs-identifier hs-var">setSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681108673"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env TcGblEnv TcLclEnv) ()
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; FreeVars -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#warnUnusedRecordWildcard"><span class="hs-identifier hs-var">warnUnusedRecordWildcard</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108671"><span class="hs-identifier hs-var">dotdot_names</span></a></span><span> </span><span class="annot"><span class="annottext">FreeVars
</span><a href="#local-6989586621681108672"><span class="hs-identifier hs-var">fvs</span></a></span><span>
</span><span id="line-375"></span><span>
</span><span id="line-376"></span><span>
</span><span id="line-377"></span><span class="hs-comment">-- | Produce a warning when the `..` pattern binds no new</span><span>
</span><span id="line-378"></span><span class="hs-comment">-- variables.</span><span>
</span><span id="line-379"></span><span class="hs-comment">--</span><span>
</span><span id="line-380"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-381"></span><span class="hs-comment">--   data P = P { x :: Int }</span><span>
</span><span id="line-382"></span><span class="hs-comment">--</span><span>
</span><span id="line-383"></span><span class="hs-comment">--   foo (P{x, ..}) = x</span><span>
</span><span id="line-384"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-385"></span><span class="hs-comment">--</span><span>
</span><span id="line-386"></span><span class="hs-comment">-- The `..` here doesn't bind any variables as `x` is already bound.</span><span>
</span><span id="line-387"></span><span class="annot"><a href="GHC.Rename.Utils.html#warnRedundantRecordWildcard"><span class="hs-identifier hs-type">warnRedundantRecordWildcard</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-388"></span><span id="warnRedundantRecordWildcard"><span class="annot"><span class="annottext">warnRedundantRecordWildcard :: IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#warnRedundantRecordWildcard"><span class="hs-identifier hs-var hs-var">warnRedundantRecordWildcard</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-389"></span><span>  </span><span class="annot"><span class="annottext">WarningFlag
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall gbl lcl.
WarningFlag -&gt; TcRnIf gbl lcl () -&gt; TcRnIf gbl lcl ()
</span><a href="GHC.Tc.Utils.Monad.html#whenWOptM"><span class="hs-identifier hs-var">whenWOptM</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnRedundantRecordWildcards"><span class="hs-identifier hs-var">Opt_WarnRedundantRecordWildcards</span></a></span><span>
</span><span id="line-390"></span><span>            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WarnReason -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#addWarn"><span class="hs-identifier hs-var">addWarn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WarningFlag -&gt; WarnReason
</span><a href="GHC.Driver.Flags.html#Reason"><span class="hs-identifier hs-var">Reason</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnRedundantRecordWildcards"><span class="hs-identifier hs-var">Opt_WarnRedundantRecordWildcards</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-391"></span><span>                     </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Rename.Utils.html#redundantWildcardWarning"><span class="hs-identifier hs-var">redundantWildcardWarning</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-392"></span><span>
</span><span id="line-393"></span><span>
</span><span id="line-394"></span><span class="hs-comment">-- | Produce a warning when no variables bound by a `..` pattern are used.</span><span>
</span><span id="line-395"></span><span class="hs-comment">--</span><span>
</span><span id="line-396"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-397"></span><span class="hs-comment">--   data P = P { x :: Int }</span><span>
</span><span id="line-398"></span><span class="hs-comment">--</span><span>
</span><span id="line-399"></span><span class="hs-comment">--   foo (P{..}) = ()</span><span>
</span><span id="line-400"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-401"></span><span class="hs-comment">--</span><span>
</span><span id="line-402"></span><span class="hs-comment">-- The `..` pattern binds `x` but it is not used in the RHS so we issue</span><span>
</span><span id="line-403"></span><span class="hs-comment">-- a warning.</span><span>
</span><span id="line-404"></span><span class="annot"><a href="GHC.Rename.Utils.html#warnUnusedRecordWildcard"><span class="hs-identifier hs-type">warnUnusedRecordWildcard</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-405"></span><span id="warnUnusedRecordWildcard"><span class="annot"><span class="annottext">warnUnusedRecordWildcard :: [Name] -&gt; FreeVars -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#warnUnusedRecordWildcard"><span class="hs-identifier hs-var hs-var">warnUnusedRecordWildcard</span></a></span></span><span> </span><span id="local-6989586621681108666"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108666"><span class="hs-identifier hs-var">ns</span></a></span></span><span> </span><span id="local-6989586621681108665"><span class="annot"><span class="annottext">FreeVars
</span><a href="#local-6989586621681108665"><span class="hs-identifier hs-var">used_names</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-406"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681108664"><span class="annot"><span class="annottext">used :: [Name]
</span><a href="#local-6989586621681108664"><span class="hs-identifier hs-var hs-var">used</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Name -&gt; Bool) -&gt; [Name] -&gt; [Name]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; FreeVars -&gt; Bool
</span><a href="GHC.Types.Name.Set.html#elemNameSet"><span class="hs-operator hs-var">`elemNameSet`</span></a></span><span> </span><span class="annot"><span class="annottext">FreeVars
</span><a href="#local-6989586621681108665"><span class="hs-identifier hs-var">used_names</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108666"><span class="hs-identifier hs-var">ns</span></a></span><span>
</span><span id="line-407"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#traceRn"><span class="hs-identifier hs-var">traceRn</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;warnUnused&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Name] -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108666"><span class="hs-identifier hs-var">ns</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">FreeVars -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">FreeVars
</span><a href="#local-6989586621681108665"><span class="hs-identifier hs-var">used_names</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108664"><span class="hs-identifier hs-var">used</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-408"></span><span>  </span><span class="annot"><span class="annottext">WarningFlag -&gt; Bool -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#warnIfFlag"><span class="hs-identifier hs-var">warnIfFlag</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnUnusedRecordWildcards"><span class="hs-identifier hs-var">Opt_WarnUnusedRecordWildcards</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Name] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108664"><span class="hs-identifier hs-var">used</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-409"></span><span>    </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Rename.Utils.html#unusedRecordWildcardWarning"><span class="hs-identifier hs-var">unusedRecordWildcardWarning</span></a></span><span>
</span><span id="line-410"></span><span>
</span><span id="line-411"></span><span>
</span><span id="line-412"></span><span>
</span><span id="line-413"></span><span class="annot"><a href="GHC.Rename.Utils.html#warnUnusedLocalBinds"><span class="hs-identifier hs-type">warnUnusedLocalBinds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#warnUnusedMatches"><span class="hs-identifier hs-type">warnUnusedMatches</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#warnUnusedTypePatterns"><span class="hs-identifier hs-type">warnUnusedTypePatterns</span></a></span><span>
</span><span id="line-414"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-415"></span><span id="warnUnusedLocalBinds"><span class="annot"><span class="annottext">warnUnusedLocalBinds :: [Name] -&gt; FreeVars -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#warnUnusedLocalBinds"><span class="hs-identifier hs-var hs-var">warnUnusedLocalBinds</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WarningFlag
-&gt; [Name] -&gt; FreeVars -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#check_unused"><span class="hs-identifier hs-var">check_unused</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnUnusedLocalBinds"><span class="hs-identifier hs-var">Opt_WarnUnusedLocalBinds</span></a></span><span>
</span><span id="line-416"></span><span id="warnUnusedMatches"><span class="annot"><span class="annottext">warnUnusedMatches :: [Name] -&gt; FreeVars -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#warnUnusedMatches"><span class="hs-identifier hs-var hs-var">warnUnusedMatches</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WarningFlag
-&gt; [Name] -&gt; FreeVars -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#check_unused"><span class="hs-identifier hs-var">check_unused</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnUnusedMatches"><span class="hs-identifier hs-var">Opt_WarnUnusedMatches</span></a></span><span>
</span><span id="line-417"></span><span id="warnUnusedTypePatterns"><span class="annot"><span class="annottext">warnUnusedTypePatterns :: [Name] -&gt; FreeVars -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#warnUnusedTypePatterns"><span class="hs-identifier hs-var hs-var">warnUnusedTypePatterns</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WarningFlag
-&gt; [Name] -&gt; FreeVars -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#check_unused"><span class="hs-identifier hs-var">check_unused</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnUnusedTypePatterns"><span class="hs-identifier hs-var">Opt_WarnUnusedTypePatterns</span></a></span><span>
</span><span id="line-418"></span><span>
</span><span id="line-419"></span><span class="annot"><a href="GHC.Rename.Utils.html#check_unused"><span class="hs-identifier hs-type">check_unused</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Flags.html#WarningFlag"><span class="hs-identifier hs-type">WarningFlag</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-420"></span><span id="check_unused"><span class="annot"><span class="annottext">check_unused :: WarningFlag
-&gt; [Name] -&gt; FreeVars -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#check_unused"><span class="hs-identifier hs-var hs-var">check_unused</span></a></span></span><span> </span><span id="local-6989586621681108653"><span class="annot"><span class="annottext">WarningFlag
</span><a href="#local-6989586621681108653"><span class="hs-identifier hs-var">flag</span></a></span></span><span> </span><span id="local-6989586621681108652"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108652"><span class="hs-identifier hs-var">bound_names</span></a></span></span><span> </span><span id="local-6989586621681108651"><span class="annot"><span class="annottext">FreeVars
</span><a href="#local-6989586621681108651"><span class="hs-identifier hs-var">used_names</span></a></span></span><span>
</span><span id="line-421"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WarningFlag
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall gbl lcl.
WarningFlag -&gt; TcRnIf gbl lcl () -&gt; TcRnIf gbl lcl ()
</span><a href="GHC.Tc.Utils.Monad.html#whenWOptM"><span class="hs-identifier hs-var">whenWOptM</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="#local-6989586621681108653"><span class="hs-identifier hs-var">flag</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WarningFlag -&gt; [Name] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#warnUnused"><span class="hs-identifier hs-var">warnUnused</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="#local-6989586621681108653"><span class="hs-identifier hs-var">flag</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Name -&gt; Bool) -&gt; [Name] -&gt; [Name]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="GHC.Utils.Misc.html#filterOut"><span class="hs-identifier hs-var">filterOut</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; FreeVars -&gt; Bool
</span><a href="GHC.Types.Name.Set.html#elemNameSet"><span class="hs-operator hs-var">`elemNameSet`</span></a></span><span> </span><span class="annot"><span class="annottext">FreeVars
</span><a href="#local-6989586621681108651"><span class="hs-identifier hs-var">used_names</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-422"></span><span>                                               </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108652"><span class="hs-identifier hs-var">bound_names</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-423"></span><span>
</span><span id="line-424"></span><span class="hs-comment">-------------------------</span><span>
</span><span id="line-425"></span><span class="hs-comment">--      Helpers</span><span>
</span><span id="line-426"></span><span class="annot"><a href="GHC.Rename.Utils.html#warnUnusedGREs"><span class="hs-identifier hs-type">warnUnusedGREs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrElt"><span class="hs-identifier hs-type">GlobalRdrElt</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-427"></span><span id="warnUnusedGREs"><span class="annot"><span class="annottext">warnUnusedGREs :: [GlobalRdrElt] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#warnUnusedGREs"><span class="hs-identifier hs-var hs-var">warnUnusedGREs</span></a></span></span><span> </span><span id="local-6989586621681108649"><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681108649"><span class="hs-identifier hs-var">gres</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GlobalRdrElt -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; [GlobalRdrElt] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#warnUnusedGRE"><span class="hs-identifier hs-var">warnUnusedGRE</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681108649"><span class="hs-identifier hs-var">gres</span></a></span><span>
</span><span id="line-428"></span><span>
</span><span id="line-429"></span><span class="annot"><a href="GHC.Rename.Utils.html#warnUnused"><span class="hs-identifier hs-type">warnUnused</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Flags.html#WarningFlag"><span class="hs-identifier hs-type">WarningFlag</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-430"></span><span id="warnUnused"><span class="annot"><span class="annottext">warnUnused :: WarningFlag -&gt; [Name] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#warnUnused"><span class="hs-identifier hs-var hs-var">warnUnused</span></a></span></span><span> </span><span id="local-6989586621681108647"><span class="annot"><span class="annottext">WarningFlag
</span><a href="#local-6989586621681108647"><span class="hs-identifier hs-var">flag</span></a></span></span><span> </span><span id="local-6989586621681108646"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108646"><span class="hs-identifier hs-var">names</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-431"></span><span>    </span><span id="local-6989586621681108645"><span class="annot"><span class="annottext">NameEnv (FieldLabelString, Name)
</span><a href="#local-6989586621681108645"><span class="hs-identifier hs-var">fld_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; NameEnv (FieldLabelString, Name)
</span><a href="GHC.Rename.Utils.html#mkFieldEnv"><span class="hs-identifier hs-var">mkFieldEnv</span></a></span><span> </span><span class="annot"><span class="annottext">(GlobalRdrEnv -&gt; NameEnv (FieldLabelString, Name))
-&gt; IOEnv (Env TcGblEnv TcLclEnv) GlobalRdrEnv
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (NameEnv (FieldLabelString, Name))
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) GlobalRdrEnv
</span><a href="GHC.Tc.Utils.Monad.html#getGlobalRdrEnv"><span class="hs-identifier hs-var">getGlobalRdrEnv</span></a></span><span>
</span><span id="line-432"></span><span>    </span><span class="annot"><span class="annottext">(Name -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; [Name] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WarningFlag
-&gt; NameEnv (FieldLabelString, Name)
-&gt; Name
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#warnUnused1"><span class="hs-identifier hs-var">warnUnused1</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="#local-6989586621681108647"><span class="hs-identifier hs-var">flag</span></a></span><span> </span><span class="annot"><span class="annottext">NameEnv (FieldLabelString, Name)
</span><a href="#local-6989586621681108645"><span class="hs-identifier hs-var">fld_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681108646"><span class="hs-identifier hs-var">names</span></a></span><span>
</span><span id="line-433"></span><span>
</span><span id="line-434"></span><span class="annot"><a href="GHC.Rename.Utils.html#warnUnused1"><span class="hs-identifier hs-type">warnUnused1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Flags.html#WarningFlag"><span class="hs-identifier hs-type">WarningFlag</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html#NameEnv"><span class="hs-identifier hs-type">NameEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.FieldLabel.html#FieldLabelString"><span class="hs-identifier hs-type">FieldLabelString</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-435"></span><span id="warnUnused1"><span class="annot"><span class="annottext">warnUnused1 :: WarningFlag
-&gt; NameEnv (FieldLabelString, Name)
-&gt; Name
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#warnUnused1"><span class="hs-identifier hs-var hs-var">warnUnused1</span></a></span></span><span> </span><span id="local-6989586621681108641"><span class="annot"><span class="annottext">WarningFlag
</span><a href="#local-6989586621681108641"><span class="hs-identifier hs-var">flag</span></a></span></span><span> </span><span id="local-6989586621681108640"><span class="annot"><span class="annottext">NameEnv (FieldLabelString, Name)
</span><a href="#local-6989586621681108640"><span class="hs-identifier hs-var">fld_env</span></a></span></span><span> </span><span id="local-6989586621681108639"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108639"><span class="hs-identifier hs-var">name</span></a></span></span><span>
</span><span id="line-436"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; OccName -&gt; Bool
</span><a href="GHC.Rename.Utils.html#reportable"><span class="hs-identifier hs-var">reportable</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108639"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681108636"><span class="hs-identifier hs-var">occ</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env TcGblEnv TcLclEnv) ()
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-437"></span><span>    </span><span class="annot"><span class="annottext">WarningFlag
-&gt; OccName -&gt; SrcSpan -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#addUnusedWarning"><span class="hs-identifier hs-var">addUnusedWarning</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="#local-6989586621681108641"><span class="hs-identifier hs-var">flag</span></a></span><span>
</span><span id="line-438"></span><span>                     </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681108636"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SrcSpan
</span><a href="GHC.Types.Name.html#nameSrcSpan"><span class="hs-identifier hs-var">nameSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108639"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-439"></span><span>                     </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; MsgDoc) -&gt; String -&gt; MsgDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Defined but not used&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681108634"><span class="hs-identifier hs-var">opt_str</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-440"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-441"></span><span>    </span><span id="local-6989586621681108636"><span class="annot"><span class="annottext">occ :: OccName
</span><a href="#local-6989586621681108636"><span class="hs-identifier hs-var hs-var">occ</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">NameEnv (FieldLabelString, Name)
-&gt; Name -&gt; Maybe (FieldLabelString, Name)
forall a. NameEnv a -&gt; Name -&gt; Maybe a
</span><a href="GHC.Types.Name.Env.html#lookupNameEnv"><span class="hs-identifier hs-var">lookupNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">NameEnv (FieldLabelString, Name)
</span><a href="#local-6989586621681108640"><span class="hs-identifier hs-var">fld_env</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108639"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-442"></span><span>              </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681108632"><span class="annot"><span class="annottext">FieldLabelString
</span><a href="#local-6989586621681108632"><span class="hs-identifier hs-var">fl</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FieldLabelString -&gt; OccName
</span><a href="GHC.Types.Name.Occurrence.html#mkVarOccFS"><span class="hs-identifier hs-var">mkVarOccFS</span></a></span><span> </span><span class="annot"><span class="annottext">FieldLabelString
</span><a href="#local-6989586621681108632"><span class="hs-identifier hs-var">fl</span></a></span><span>
</span><span id="line-443"></span><span>              </span><span class="annot"><span class="annottext">Maybe (FieldLabelString, Name)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108639"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-444"></span><span>    </span><span id="local-6989586621681108634"><span class="annot"><span class="annottext">opt_str :: String
</span><a href="#local-6989586621681108634"><span class="hs-identifier hs-var hs-var">opt_str</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="#local-6989586621681108641"><span class="hs-identifier hs-var">flag</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-445"></span><span>                </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnUnusedTypePatterns"><span class="hs-identifier hs-var">Opt_WarnUnusedTypePatterns</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; on the right hand side&quot;</span></span><span>
</span><span id="line-446"></span><span>                </span><span class="annot"><span class="annottext">WarningFlag
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-447"></span><span>
</span><span id="line-448"></span><span class="annot"><a href="GHC.Rename.Utils.html#warnUnusedGRE"><span class="hs-identifier hs-type">warnUnusedGRE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrElt"><span class="hs-identifier hs-type">GlobalRdrElt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-449"></span><span id="warnUnusedGRE"><span class="annot"><span class="annottext">warnUnusedGRE :: GlobalRdrElt -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#warnUnusedGRE"><span class="hs-identifier hs-var hs-var">warnUnusedGRE</span></a></span></span><span> </span><span id="local-6989586621681108630"><span class="annot"><span class="annottext">gre :: GlobalRdrElt
</span><a href="#local-6989586621681108630"><span class="hs-identifier hs-var">gre</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Reader.html#GRE"><span class="hs-identifier hs-type">GRE</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">gre_name :: GlobalRdrElt -&gt; Name
</span><a href="GHC.Types.Name.Reader.html#gre_name"><span class="hs-identifier hs-var">gre_name</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681108627"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108627"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">gre_lcl :: GlobalRdrElt -&gt; Bool
</span><a href="GHC.Types.Name.Reader.html#gre_lcl"><span class="hs-identifier hs-var">gre_lcl</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681108625"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681108625"><span class="hs-identifier hs-var">lcl</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">gre_imp :: GlobalRdrElt -&gt; [ImportSpec]
</span><a href="GHC.Types.Name.Reader.html#gre_imp"><span class="hs-identifier hs-var">gre_imp</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681108623"><span class="annot"><span class="annottext">[ImportSpec]
</span><a href="#local-6989586621681108623"><span class="hs-identifier hs-var">is</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-450"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681108625"><span class="hs-identifier hs-var">lcl</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681108622"><span class="annot"><span class="annottext">NameEnv (FieldLabelString, Name)
</span><a href="#local-6989586621681108622"><span class="hs-identifier hs-var">fld_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; NameEnv (FieldLabelString, Name)
</span><a href="GHC.Rename.Utils.html#mkFieldEnv"><span class="hs-identifier hs-var">mkFieldEnv</span></a></span><span> </span><span class="annot"><span class="annottext">(GlobalRdrEnv -&gt; NameEnv (FieldLabelString, Name))
-&gt; IOEnv (Env TcGblEnv TcLclEnv) GlobalRdrEnv
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (NameEnv (FieldLabelString, Name))
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) GlobalRdrEnv
</span><a href="GHC.Tc.Utils.Monad.html#getGlobalRdrEnv"><span class="hs-identifier hs-var">getGlobalRdrEnv</span></a></span><span>
</span><span id="line-451"></span><span>                   </span><span class="annot"><span class="annottext">WarningFlag
-&gt; NameEnv (FieldLabelString, Name)
-&gt; Name
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#warnUnused1"><span class="hs-identifier hs-var">warnUnused1</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnUnusedTopBinds"><span class="hs-identifier hs-var">Opt_WarnUnusedTopBinds</span></a></span><span> </span><span class="annot"><span class="annottext">NameEnv (FieldLabelString, Name)
</span><a href="#local-6989586621681108622"><span class="hs-identifier hs-var">fld_env</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108627"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-452"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; OccName -&gt; Bool
</span><a href="GHC.Rename.Utils.html#reportable"><span class="hs-identifier hs-var">reportable</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108627"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681108621"><span class="hs-identifier hs-var">occ</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(ImportSpec -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; [ImportSpec] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="annot"><span class="annottext">ImportSpec -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="#local-6989586621681108620"><span class="hs-identifier hs-var">warn</span></a></span><span> </span><span class="annot"><span class="annottext">[ImportSpec]
</span><a href="#local-6989586621681108623"><span class="hs-identifier hs-var">is</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-453"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-454"></span><span>    </span><span id="local-6989586621681108621"><span class="annot"><span class="annottext">occ :: OccName
</span><a href="#local-6989586621681108621"><span class="hs-identifier hs-var hs-var">occ</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; OccName
</span><a href="GHC.Types.Name.Reader.html#greOccName"><span class="hs-identifier hs-var">greOccName</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681108630"><span class="hs-identifier hs-var">gre</span></a></span><span>
</span><span id="line-455"></span><span>    </span><span id="local-6989586621681108620"><span class="annot"><span class="annottext">warn :: ImportSpec -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="#local-6989586621681108620"><span class="hs-identifier hs-var hs-var">warn</span></a></span></span><span> </span><span id="local-6989586621681108618"><span class="annot"><span class="annottext">ImportSpec
</span><a href="#local-6989586621681108618"><span class="hs-identifier hs-var">spec</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WarningFlag
-&gt; OccName -&gt; SrcSpan -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#addUnusedWarning"><span class="hs-identifier hs-var">addUnusedWarning</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnUnusedTopBinds"><span class="hs-identifier hs-var">Opt_WarnUnusedTopBinds</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681108621"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681108617"><span class="hs-identifier hs-var">span</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108616"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-456"></span><span>        </span><span class="hs-keyword">where</span><span>
</span><span id="line-457"></span><span>           </span><span id="local-6989586621681108617"><span class="annot"><span class="annottext">span :: SrcSpan
</span><a href="#local-6989586621681108617"><span class="hs-identifier hs-var hs-var">span</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ImportSpec -&gt; SrcSpan
</span><a href="GHC.Types.Name.Reader.html#importSpecLoc"><span class="hs-identifier hs-var">importSpecLoc</span></a></span><span> </span><span class="annot"><span class="annottext">ImportSpec
</span><a href="#local-6989586621681108618"><span class="hs-identifier hs-var">spec</span></a></span><span>
</span><span id="line-458"></span><span>           </span><span id="local-6989586621681108614"><span class="annot"><span class="annottext">pp_mod :: MsgDoc
</span><a href="#local-6989586621681108614"><span class="hs-identifier hs-var hs-var">pp_mod</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ImportSpec -&gt; ModuleName
</span><a href="GHC.Types.Name.Reader.html#importSpecModule"><span class="hs-identifier hs-var">importSpecModule</span></a></span><span> </span><span class="annot"><span class="annottext">ImportSpec
</span><a href="#local-6989586621681108618"><span class="hs-identifier hs-var">spec</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-459"></span><span>           </span><span id="local-6989586621681108616"><span class="annot"><span class="annottext">msg :: MsgDoc
</span><a href="#local-6989586621681108616"><span class="hs-identifier hs-var hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Imported from&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108614"><span class="hs-identifier hs-var">pp_mod</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">PtrString -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ptext"><span class="hs-identifier hs-var">ptext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; PtrString
</span><a href="GHC.Data.FastString.html#sLit"><span class="hs-identifier hs-var">sLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;but not used&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-460"></span><span>
</span><span id="line-461"></span><span class="hs-comment">-- | Make a map from selector names to field labels and parent tycon</span><span>
</span><span id="line-462"></span><span class="hs-comment">-- names, to be used when reporting unused record fields.</span><span>
</span><span id="line-463"></span><span class="annot"><a href="GHC.Rename.Utils.html#mkFieldEnv"><span class="hs-identifier hs-type">mkFieldEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrEnv"><span class="hs-identifier hs-type">GlobalRdrEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html#NameEnv"><span class="hs-identifier hs-type">NameEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.FieldLabel.html#FieldLabelString"><span class="hs-identifier hs-type">FieldLabelString</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-464"></span><span id="mkFieldEnv"><span class="annot"><span class="annottext">mkFieldEnv :: GlobalRdrEnv -&gt; NameEnv (FieldLabelString, Name)
</span><a href="GHC.Rename.Utils.html#mkFieldEnv"><span class="hs-identifier hs-var hs-var">mkFieldEnv</span></a></span></span><span> </span><span id="local-6989586621681108610"><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681108610"><span class="hs-identifier hs-var">rdr_env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Name, (FieldLabelString, Name))]
-&gt; NameEnv (FieldLabelString, Name)
forall a. [(Name, a)] -&gt; NameEnv a
</span><a href="GHC.Types.Name.Env.html#mkNameEnv"><span class="hs-identifier hs-var">mkNameEnv</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; Name
</span><a href="GHC.Types.Name.Reader.html#gre_name"><span class="hs-identifier hs-var hs-var">gre_name</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681108608"><span class="hs-identifier hs-var">gre</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FieldLabelString
</span><a href="#local-6989586621681108607"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Parent -&gt; Name
</span><a href="GHC.Types.Name.Reader.html#par_is"><span class="hs-identifier hs-var hs-var">par_is</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; Parent
</span><a href="GHC.Types.Name.Reader.html#gre_par"><span class="hs-identifier hs-var hs-var">gre_par</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681108608"><span class="hs-identifier hs-var">gre</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-465"></span><span>                               </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681108605"><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681108605"><span class="hs-identifier hs-var">gres</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; [[GlobalRdrElt]]
forall a. OccEnv a -&gt; [a]
</span><a href="GHC.Types.Name.Occurrence.html#occEnvElts"><span class="hs-identifier hs-var">occEnvElts</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681108610"><span class="hs-identifier hs-var">rdr_env</span></a></span><span>
</span><span id="line-466"></span><span>                               </span><span class="hs-special">,</span><span> </span><span id="local-6989586621681108608"><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681108608"><span class="hs-identifier hs-var">gre</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681108605"><span class="hs-identifier hs-var">gres</span></a></span><span>
</span><span id="line-467"></span><span>                               </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681108607"><span class="annot"><span class="annottext">FieldLabelString
</span><a href="#local-6989586621681108607"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; Maybe FieldLabelString
</span><a href="GHC.Types.Name.Reader.html#greLabel"><span class="hs-identifier hs-var">greLabel</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681108608"><span class="hs-identifier hs-var">gre</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-468"></span><span>                               </span><span class="hs-special">]</span><span>
</span><span id="line-469"></span><span>
</span><span id="line-470"></span><span class="hs-comment">-- | Should we report the fact that this 'Name' is unused? The</span><span>
</span><span id="line-471"></span><span class="hs-comment">-- 'OccName' may differ from 'nameOccName' due to</span><span>
</span><span id="line-472"></span><span class="hs-comment">-- DuplicateRecordFields.</span><span>
</span><span id="line-473"></span><span class="annot"><a href="GHC.Rename.Utils.html#reportable"><span class="hs-identifier hs-type">reportable</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccName"><span class="hs-identifier hs-type">OccName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-474"></span><span id="reportable"><span class="annot"><span class="annottext">reportable :: Name -&gt; OccName -&gt; Bool
</span><a href="GHC.Rename.Utils.html#reportable"><span class="hs-identifier hs-var hs-var">reportable</span></a></span></span><span> </span><span id="local-6989586621681108602"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108602"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621681108601"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681108601"><span class="hs-identifier hs-var">occ</span></a></span></span><span>
</span><span id="line-475"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Types.Name.html#isWiredInName"><span class="hs-identifier hs-var">isWiredInName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108602"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>    </span><span class="hs-comment">-- Don't report unused wired-in names</span><span>
</span><span id="line-476"></span><span>                                  </span><span class="hs-comment">-- Otherwise we get a zillion warnings</span><span>
</span><span id="line-477"></span><span>                                  </span><span class="hs-comment">-- from Data.Tuple</span><span>
</span><span id="line-478"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; Bool
</span><a href="GHC.Types.Name.Occurrence.html#startsWithUnderscore"><span class="hs-identifier hs-var">startsWithUnderscore</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681108601"><span class="hs-identifier hs-var">occ</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-479"></span><span>
</span><span id="line-480"></span><span class="annot"><a href="GHC.Rename.Utils.html#addUnusedWarning"><span class="hs-identifier hs-type">addUnusedWarning</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Flags.html#WarningFlag"><span class="hs-identifier hs-type">WarningFlag</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccName"><span class="hs-identifier hs-type">OccName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-481"></span><span id="addUnusedWarning"><span class="annot"><span class="annottext">addUnusedWarning :: WarningFlag
-&gt; OccName -&gt; SrcSpan -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#addUnusedWarning"><span class="hs-identifier hs-var hs-var">addUnusedWarning</span></a></span></span><span> </span><span id="local-6989586621681108599"><span class="annot"><span class="annottext">WarningFlag
</span><a href="#local-6989586621681108599"><span class="hs-identifier hs-var">flag</span></a></span></span><span> </span><span id="local-6989586621681108598"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681108598"><span class="hs-identifier hs-var">occ</span></a></span></span><span> </span><span id="local-6989586621681108597"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681108597"><span class="hs-identifier hs-var">span</span></a></span></span><span> </span><span id="local-6989586621681108596"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108596"><span class="hs-identifier hs-var">msg</span></a></span></span><span>
</span><span id="line-482"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WarnReason -&gt; SrcSpan -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#addWarnAt"><span class="hs-identifier hs-var">addWarnAt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WarningFlag -&gt; WarnReason
</span><a href="GHC.Driver.Flags.html#Reason"><span class="hs-identifier hs-var">Reason</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="#local-6989586621681108599"><span class="hs-identifier hs-var">flag</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681108597"><span class="hs-identifier hs-var">span</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-483"></span><span>    </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#sep"><span class="hs-identifier hs-var">sep</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108596"><span class="hs-identifier hs-var">msg</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#colon"><span class="hs-identifier hs-var">colon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-484"></span><span>         </span><span class="annot"><span class="annottext">Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#nest"><span class="hs-identifier hs-var">nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; MsgDoc) -&gt; MsgDoc -&gt; MsgDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">NameSpace -&gt; MsgDoc
</span><a href="GHC.Types.Name.Occurrence.html#pprNonVarNameSpace"><span class="hs-identifier hs-var">pprNonVarNameSpace</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; NameSpace
</span><a href="GHC.Types.Name.Occurrence.html#occNameSpace"><span class="hs-identifier hs-var hs-var">occNameSpace</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681108598"><span class="hs-identifier hs-var">occ</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-485"></span><span>                        </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681108598"><span class="hs-identifier hs-var">occ</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-486"></span><span>
</span><span id="line-487"></span><span class="annot"><a href="GHC.Rename.Utils.html#unusedRecordWildcardWarning"><span class="hs-identifier hs-type">unusedRecordWildcardWarning</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-488"></span><span id="unusedRecordWildcardWarning"><span class="annot"><span class="annottext">unusedRecordWildcardWarning :: MsgDoc
</span><a href="GHC.Rename.Utils.html#unusedRecordWildcardWarning"><span class="hs-identifier hs-var hs-var">unusedRecordWildcardWarning</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-489"></span><span>  </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Rename.Utils.html#wildcardDoc"><span class="hs-identifier hs-var">wildcardDoc</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; MsgDoc) -&gt; MsgDoc -&gt; MsgDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;No variables bound in the record wildcard match are used&quot;</span></span><span>
</span><span id="line-490"></span><span>
</span><span id="line-491"></span><span class="annot"><a href="GHC.Rename.Utils.html#redundantWildcardWarning"><span class="hs-identifier hs-type">redundantWildcardWarning</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-492"></span><span id="redundantWildcardWarning"><span class="annot"><span class="annottext">redundantWildcardWarning :: MsgDoc
</span><a href="GHC.Rename.Utils.html#redundantWildcardWarning"><span class="hs-identifier hs-var hs-var">redundantWildcardWarning</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-493"></span><span>  </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Rename.Utils.html#wildcardDoc"><span class="hs-identifier hs-var">wildcardDoc</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; MsgDoc) -&gt; MsgDoc -&gt; MsgDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Record wildcard does not bind any new variables&quot;</span></span><span>
</span><span id="line-494"></span><span>
</span><span id="line-495"></span><span class="annot"><a href="GHC.Rename.Utils.html#wildcardDoc"><span class="hs-identifier hs-type">wildcardDoc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-496"></span><span id="wildcardDoc"><span class="annot"><span class="annottext">wildcardDoc :: MsgDoc -&gt; MsgDoc
</span><a href="GHC.Rename.Utils.html#wildcardDoc"><span class="hs-identifier hs-var hs-var">wildcardDoc</span></a></span></span><span> </span><span id="local-6989586621681108589"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108589"><span class="hs-identifier hs-var">herald</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-497"></span><span>  </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108589"><span class="hs-identifier hs-var">herald</span></a></span><span>
</span><span id="line-498"></span><span>    </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#nest"><span class="hs-identifier hs-var">nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Possible fix&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#colon"><span class="hs-identifier hs-var">colon</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;omit the&quot;</span></span><span>
</span><span id="line-499"></span><span>                                            </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;..&quot;</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-500"></span><span>
</span><span id="line-501"></span><span class="annot"><a href="GHC.Rename.Utils.html#addNameClashErrRn"><span class="hs-identifier hs-type">addNameClashErrRn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrElt"><span class="hs-identifier hs-type">GlobalRdrElt</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-502"></span><span id="addNameClashErrRn"><span class="annot"><span class="annottext">addNameClashErrRn :: RdrName -&gt; [GlobalRdrElt] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#addNameClashErrRn"><span class="hs-identifier hs-var hs-var">addNameClashErrRn</span></a></span></span><span> </span><span id="local-6989586621681108588"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681108588"><span class="hs-identifier hs-var">rdr_name</span></a></span></span><span> </span><span id="local-6989586621681108587"><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681108587"><span class="hs-identifier hs-var">gres</span></a></span></span><span>
</span><span id="line-503"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">(GlobalRdrElt -&gt; Bool) -&gt; [GlobalRdrElt] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#all"><span class="hs-identifier hs-var">all</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; Bool
</span><a href="GHC.Types.Name.Reader.html#isLocalGRE"><span class="hs-identifier hs-var">isLocalGRE</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681108587"><span class="hs-identifier hs-var">gres</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(GlobalRdrElt -&gt; Bool) -&gt; [GlobalRdrElt] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#all"><span class="hs-identifier hs-var">all</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; Bool
</span><a href="GHC.Types.Name.Reader.html#isRecFldGRE"><span class="hs-identifier hs-var">isRecFldGRE</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681108587"><span class="hs-identifier hs-var">gres</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-504"></span><span>               </span><span class="hs-comment">-- If there are two or more *local* defns, we'll have reported</span><span>
</span><span id="line-505"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- that already, and we don't want an error cascade</span><span>
</span><span id="line-506"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-507"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#addErr"><span class="hs-identifier hs-var">addErr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Ambiguous occurrence&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681108588"><span class="hs-identifier hs-var">rdr_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-508"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;It could refer to&quot;</span></span><span>
</span><span id="line-509"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#nest"><span class="hs-identifier hs-var">nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">3</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108583"><span class="hs-identifier hs-var">msg1</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; [MsgDoc] -&gt; [MsgDoc]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[MsgDoc]
</span><a href="#local-6989586621681108582"><span class="hs-identifier hs-var">msgs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-510"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-511"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681108581"><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681108581"><span class="hs-identifier hs-var">np1</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681108580"><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681108580"><span class="hs-identifier hs-var">nps</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681108587"><span class="hs-identifier hs-var">gres</span></a></span><span>
</span><span id="line-512"></span><span>    </span><span id="local-6989586621681108583"><span class="annot"><span class="annottext">msg1 :: MsgDoc
</span><a href="#local-6989586621681108583"><span class="hs-identifier hs-var hs-var">msg1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;either&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; MsgDoc
</span><a href="#local-6989586621681108579"><span class="hs-identifier hs-var">ppr_gre</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681108581"><span class="hs-identifier hs-var">np1</span></a></span><span>
</span><span id="line-513"></span><span>    </span><span id="local-6989586621681108582"><span class="annot"><span class="annottext">msgs :: [MsgDoc]
</span><a href="#local-6989586621681108582"><span class="hs-identifier hs-var hs-var">msgs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;    or&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; MsgDoc
</span><a href="#local-6989586621681108579"><span class="hs-identifier hs-var">ppr_gre</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681108578"><span class="hs-identifier hs-var">np</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681108578"><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681108578"><span class="hs-identifier hs-var">np</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681108580"><span class="hs-identifier hs-var">nps</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-514"></span><span>    </span><span id="local-6989586621681108579"><span class="annot"><span class="annottext">ppr_gre :: GlobalRdrElt -&gt; MsgDoc
</span><a href="#local-6989586621681108579"><span class="hs-identifier hs-var hs-var">ppr_gre</span></a></span></span><span> </span><span id="local-6989586621681108577"><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681108577"><span class="hs-identifier hs-var">gre</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#sep"><span class="hs-identifier hs-var">sep</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; MsgDoc
</span><a href="#local-6989586621681108576"><span class="hs-identifier hs-var">pp_gre_name</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681108577"><span class="hs-identifier hs-var">gre</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#comma"><span class="hs-identifier hs-var">comma</span></a></span><span>
</span><span id="line-515"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; MsgDoc
</span><a href="GHC.Types.Name.Reader.html#pprNameProvenance"><span class="hs-identifier hs-var">pprNameProvenance</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681108577"><span class="hs-identifier hs-var">gre</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-516"></span><span>
</span><span id="line-517"></span><span>    </span><span class="hs-comment">-- When printing the name, take care to qualify it in the same</span><span>
</span><span id="line-518"></span><span>    </span><span class="hs-comment">-- way as the provenance reported by pprNameProvenance, namely</span><span>
</span><span id="line-519"></span><span>    </span><span class="hs-comment">-- the head of 'gre_imp'.  Otherwise we get confusing reports like</span><span>
</span><span id="line-520"></span><span>    </span><span class="hs-comment">--   Ambiguous occurrence &#8216;null&#8217;</span><span>
</span><span id="line-521"></span><span>    </span><span class="hs-comment">--   It could refer to either &#8216;T15487a.null&#8217;,</span><span>
</span><span id="line-522"></span><span>    </span><span class="hs-comment">--                            imported from &#8216;Prelude&#8217; at T15487.hs:1:8-13</span><span>
</span><span id="line-523"></span><span>    </span><span class="hs-comment">--                     or ...</span><span>
</span><span id="line-524"></span><span>    </span><span class="hs-comment">-- See #15487</span><span>
</span><span id="line-525"></span><span>    </span><span id="local-6989586621681108576"><span class="annot"><span class="annottext">pp_gre_name :: GlobalRdrElt -&gt; MsgDoc
</span><a href="#local-6989586621681108576"><span class="hs-identifier hs-var hs-var">pp_gre_name</span></a></span></span><span> </span><span id="local-6989586621681108559"><span class="annot"><span class="annottext">gre :: GlobalRdrElt
</span><a href="#local-6989586621681108559"><span class="hs-identifier hs-var">gre</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Reader.html#GRE"><span class="hs-identifier hs-type">GRE</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">gre_name :: GlobalRdrElt -&gt; Name
</span><a href="GHC.Types.Name.Reader.html#gre_name"><span class="hs-identifier hs-var">gre_name</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681108558"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108558"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">gre_par :: GlobalRdrElt -&gt; Parent
</span><a href="GHC.Types.Name.Reader.html#gre_par"><span class="hs-identifier hs-var">gre_par</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681108557"><span class="annot"><span class="annottext">Parent
</span><a href="#local-6989586621681108557"><span class="hs-identifier hs-var">parent</span></a></span></span><span>
</span><span id="line-526"></span><span>                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">gre_lcl :: GlobalRdrElt -&gt; Bool
</span><a href="GHC.Types.Name.Reader.html#gre_lcl"><span class="hs-identifier hs-var">gre_lcl</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681108556"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681108556"><span class="hs-identifier hs-var">lcl</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">gre_imp :: GlobalRdrElt -&gt; [ImportSpec]
</span><a href="GHC.Types.Name.Reader.html#gre_imp"><span class="hs-identifier hs-var">gre_imp</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681108555"><span class="annot"><span class="annottext">[ImportSpec]
</span><a href="#local-6989586621681108555"><span class="hs-identifier hs-var">iss</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-527"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#FldParent"><span class="hs-identifier hs-type">FldParent</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">par_lbl :: Parent -&gt; Maybe FieldLabelString
</span><a href="GHC.Types.Name.Reader.html#par_lbl"><span class="hs-identifier hs-var">par_lbl</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681108552"><span class="annot"><span class="annottext">FieldLabelString
</span><a href="#local-6989586621681108552"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Parent
</span><a href="#local-6989586621681108557"><span class="hs-identifier hs-var">parent</span></a></span><span>
</span><span id="line-528"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;the field&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FieldLabelString -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">FieldLabelString
</span><a href="#local-6989586621681108552"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-529"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-530"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108551"><span class="hs-identifier hs-var">pp_qual</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#dot"><span class="hs-identifier hs-var">dot</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">OccName -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108558"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-531"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-532"></span><span>        </span><span id="local-6989586621681108551"><span class="annot"><span class="annottext">pp_qual :: MsgDoc
</span><a href="#local-6989586621681108551"><span class="hs-identifier hs-var hs-var">pp_qual</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681108556"><span class="hs-identifier hs-var">lcl</span></a></span><span>
</span><span id="line-533"></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Module -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Name -&gt; Module
Name -&gt; Module
</span><a href="GHC.Types.Name.html#nameModule"><span class="hs-identifier hs-var">nameModule</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681108558"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-534"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681108548"><span class="annot"><span class="annottext">ImportSpec
</span><a href="#local-6989586621681108548"><span class="hs-identifier hs-var">imp</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">[ImportSpec]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ImportSpec]
</span><a href="#local-6989586621681108555"><span class="hs-identifier hs-var">iss</span></a></span><span>  </span><span class="hs-comment">-- This 'imp' is the one that</span><span>
</span><span id="line-535"></span><span>                                  </span><span class="hs-comment">-- pprNameProvenance chooses</span><span>
</span><span id="line-536"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#ImpDeclSpec"><span class="hs-identifier hs-type">ImpDeclSpec</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">is_as :: ImpDeclSpec -&gt; ModuleName
</span><a href="GHC.Types.Name.Reader.html#is_as"><span class="hs-identifier hs-var">is_as</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681108545"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681108545"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ImportSpec -&gt; ImpDeclSpec
</span><a href="GHC.Types.Name.Reader.html#is_decl"><span class="hs-identifier hs-var hs-var">is_decl</span></a></span><span> </span><span class="annot"><span class="annottext">ImportSpec
</span><a href="#local-6989586621681108548"><span class="hs-identifier hs-var">imp</span></a></span><span>
</span><span id="line-537"></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681108545"><span class="hs-identifier hs-var">mod</span></a></span><span>
</span><span id="line-538"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-539"></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; MsgDoc
forall a. HasCallStack =&gt; String -&gt; MsgDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;addNameClassErrRn&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681108559"><span class="hs-identifier hs-var">gre</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">[ImportSpec] -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[ImportSpec]
</span><a href="#local-6989586621681108555"><span class="hs-identifier hs-var">iss</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-540"></span><span>                  </span><span class="hs-comment">-- Invariant: either 'lcl' is True or 'iss' is non-empty</span><span>
</span><span id="line-541"></span><span>
</span><span id="line-542"></span><span class="annot"><a href="GHC.Rename.Utils.html#shadowedNameWarn"><span class="hs-identifier hs-type">shadowedNameWarn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccName"><span class="hs-identifier hs-type">OccName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-543"></span><span id="shadowedNameWarn"><span class="annot"><span class="annottext">shadowedNameWarn :: OccName -&gt; [MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Rename.Utils.html#shadowedNameWarn"><span class="hs-identifier hs-var hs-var">shadowedNameWarn</span></a></span></span><span> </span><span id="local-6989586621681108542"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681108542"><span class="hs-identifier hs-var">occ</span></a></span></span><span> </span><span id="local-6989586621681108541"><span class="annot"><span class="annottext">[MsgDoc]
</span><a href="#local-6989586621681108541"><span class="hs-identifier hs-var">shadowed_locs</span></a></span></span><span>
</span><span id="line-544"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#sep"><span class="hs-identifier hs-var">sep</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;This binding for&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681108542"><span class="hs-identifier hs-var">occ</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-545"></span><span>            </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;shadows the existing binding&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
forall a. [a] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#plural"><span class="hs-identifier hs-var">plural</span></a></span><span> </span><span class="annot"><span class="annottext">[MsgDoc]
</span><a href="#local-6989586621681108541"><span class="hs-identifier hs-var">shadowed_locs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-546"></span><span>         </span><span class="annot"><span class="annottext">Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#nest"><span class="hs-identifier hs-var">nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="annot"><span class="annottext">[MsgDoc]
</span><a href="#local-6989586621681108541"><span class="hs-identifier hs-var">shadowed_locs</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-547"></span><span>
</span><span id="line-548"></span><span>
</span><span id="line-549"></span><span class="annot"><a href="GHC.Rename.Utils.html#unknownSubordinateErr"><span class="hs-identifier hs-type">unknownSubordinateErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-550"></span><span id="unknownSubordinateErr"><span class="annot"><span class="annottext">unknownSubordinateErr :: MsgDoc -&gt; RdrName -&gt; MsgDoc
</span><a href="GHC.Rename.Utils.html#unknownSubordinateErr"><span class="hs-identifier hs-var hs-var">unknownSubordinateErr</span></a></span></span><span> </span><span id="local-6989586621681108539"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108539"><span class="hs-identifier hs-var">doc</span></a></span></span><span> </span><span id="local-6989586621681108538"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681108538"><span class="hs-identifier hs-var">op</span></a></span></span><span>    </span><span class="hs-comment">-- Doc is &quot;method of class&quot; or</span><span>
</span><span id="line-551"></span><span>                                </span><span class="hs-comment">-- &quot;field of constructor&quot;</span><span>
</span><span id="line-552"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681108538"><span class="hs-identifier hs-var">op</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;is not a (visible)&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108539"><span class="hs-identifier hs-var">doc</span></a></span><span>
</span><span id="line-553"></span><span>
</span><span id="line-554"></span><span>
</span><span id="line-555"></span><span id="local-6989586621681109114"><span class="annot"><a href="GHC.Rename.Utils.html#dupNamesErr"><span class="hs-identifier hs-type">dupNamesErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681109114"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681109114"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NE.NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681109114"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-556"></span><span id="dupNamesErr"><span class="annot"><span class="annottext">dupNamesErr :: forall n.
Outputable n =&gt;
(n -&gt; SrcSpan) -&gt; NonEmpty n -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#dupNamesErr"><span class="hs-identifier hs-var hs-var">dupNamesErr</span></a></span></span><span> </span><span id="local-6989586621681108533"><span class="annot"><span class="annottext">n -&gt; SrcSpan
</span><a href="#local-6989586621681108533"><span class="hs-identifier hs-var">get_loc</span></a></span></span><span> </span><span id="local-6989586621681108532"><span class="annot"><span class="annottext">NonEmpty n
</span><a href="#local-6989586621681108532"><span class="hs-identifier hs-var">names</span></a></span></span><span>
</span><span id="line-557"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#addErrAt"><span class="hs-identifier hs-var">addErrAt</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681108531"><span class="hs-identifier hs-var">big_loc</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-558"></span><span>    </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Conflicting definitions for&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">n -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NonEmpty n -&gt; n
forall a. NonEmpty a -&gt; a
</span><a href="../../base/src/Data.List.NonEmpty.html#head"><span class="hs-identifier hs-var">NE.head</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty n
</span><a href="#local-6989586621681108532"><span class="hs-identifier hs-var">names</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-559"></span><span>          </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108529"><span class="hs-identifier hs-var">locations</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-560"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-561"></span><span>    </span><span id="local-6989586621681108528"><span class="annot"><span class="annottext">locs :: [SrcSpan]
</span><a href="#local-6989586621681108528"><span class="hs-identifier hs-var hs-var">locs</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(n -&gt; SrcSpan) -&gt; [n] -&gt; [SrcSpan]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">n -&gt; SrcSpan
</span><a href="#local-6989586621681108533"><span class="hs-identifier hs-var">get_loc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NonEmpty n -&gt; [n]
forall a. NonEmpty a -&gt; [a]
</span><a href="../../base/src/Data.List.NonEmpty.html#toList"><span class="hs-identifier hs-var">NE.toList</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty n
</span><a href="#local-6989586621681108532"><span class="hs-identifier hs-var">names</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-562"></span><span>    </span><span id="local-6989586621681108531"><span class="annot"><span class="annottext">big_loc :: SrcSpan
</span><a href="#local-6989586621681108531"><span class="hs-identifier hs-var hs-var">big_loc</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(SrcSpan -&gt; SrcSpan -&gt; SrcSpan) -&gt; [SrcSpan] -&gt; SrcSpan
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; a -&gt; a) -&gt; t a -&gt; a
</span><a href="../../base/src/Data.Foldable.html#foldr1"><span class="hs-identifier hs-var">foldr1</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; SrcSpan -&gt; SrcSpan
</span><a href="GHC.Types.SrcLoc.html#combineSrcSpans"><span class="hs-identifier hs-var">combineSrcSpans</span></a></span><span> </span><span class="annot"><span class="annottext">[SrcSpan]
</span><a href="#local-6989586621681108528"><span class="hs-identifier hs-var">locs</span></a></span><span>
</span><span id="line-563"></span><span>    </span><span id="local-6989586621681108529"><span class="annot"><span class="annottext">locations :: MsgDoc
</span><a href="#local-6989586621681108529"><span class="hs-identifier hs-var hs-var">locations</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Bound at:&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(SrcSpan -&gt; MsgDoc) -&gt; [SrcSpan] -&gt; [MsgDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(SrcSpan -&gt; SrcSpan -&gt; Ordering) -&gt; [SrcSpan] -&gt; [SrcSpan]
forall a. (a -&gt; a -&gt; Ordering) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#sortBy"><span class="hs-identifier hs-var">sortBy</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; SrcSpan -&gt; Ordering
</span><a href="GHC.Types.SrcLoc.html#leftmost_smallest"><span class="hs-identifier hs-var">SrcLoc.leftmost_smallest</span></a></span><span> </span><span class="annot"><span class="annottext">[SrcSpan]
</span><a href="#local-6989586621681108528"><span class="hs-identifier hs-var">locs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-564"></span><span>
</span><span id="line-565"></span><span class="annot"><a href="GHC.Rename.Utils.html#badQualBndrErr"><span class="hs-identifier hs-type">badQualBndrErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-566"></span><span id="badQualBndrErr"><span class="annot"><span class="annottext">badQualBndrErr :: RdrName -&gt; MsgDoc
</span><a href="GHC.Rename.Utils.html#badQualBndrErr"><span class="hs-identifier hs-var hs-var">badQualBndrErr</span></a></span></span><span> </span><span id="local-6989586621681108522"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681108522"><span class="hs-identifier hs-var">rdr_name</span></a></span></span><span>
</span><span id="line-567"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Qualified name in binding position:&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681108522"><span class="hs-identifier hs-var">rdr_name</span></a></span><span>
</span><span id="line-568"></span><span>
</span><span id="line-569"></span><span class="annot"><a href="GHC.Rename.Utils.html#typeAppErr"><span class="hs-identifier hs-type">typeAppErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Type.html#LHsType"><span class="hs-identifier hs-type">LHsType</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-570"></span><span id="typeAppErr"><span class="annot"><span class="annottext">typeAppErr :: String -&gt; LHsType GhcPs -&gt; MsgDoc
</span><a href="GHC.Rename.Utils.html#typeAppErr"><span class="hs-identifier hs-var hs-var">typeAppErr</span></a></span></span><span> </span><span id="local-6989586621681108521"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681108521"><span class="hs-identifier hs-var">what</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681108520"><span class="annot"><span class="annottext">HsType GhcPs
</span><a href="#local-6989586621681108520"><span class="hs-identifier hs-var">k</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-571"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Illegal visible&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681108521"><span class="hs-identifier hs-var">what</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;application&quot;</span></span><span>
</span><span id="line-572"></span><span>            </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'@'</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">HsType GhcPs -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsType GhcPs
</span><a href="#local-6989586621681108520"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-573"></span><span>       </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Perhaps you intended to use TypeApplications&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-574"></span><span>
</span><span id="line-575"></span><span class="annot"><a href="GHC.Rename.Utils.html#checkTupSize"><span class="hs-identifier hs-type">checkTupSize</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-576"></span><span id="checkTupSize"><span class="annot"><span class="annottext">checkTupSize :: Int -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Utils.html#checkTupSize"><span class="hs-identifier hs-var hs-var">checkTupSize</span></a></span></span><span> </span><span id="local-6989586621681108517"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681108517"><span class="hs-identifier hs-var">tup_size</span></a></span></span><span>
</span><span id="line-577"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681108517"><span class="hs-identifier hs-var">tup_size</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Settings.Constants.html#mAX_TUPLE_SIZE"><span class="hs-identifier hs-var">mAX_TUPLE_SIZE</span></a></span><span>
</span><span id="line-578"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-579"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-580"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#addErr"><span class="hs-identifier hs-var">addErr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#sep"><span class="hs-identifier hs-var">sep</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;A&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#int"><span class="hs-identifier hs-var">int</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681108517"><span class="hs-identifier hs-var">tup_size</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">PtrString -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ptext"><span class="hs-identifier hs-var">ptext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; PtrString
</span><a href="GHC.Data.FastString.html#sLit"><span class="hs-identifier hs-var">sLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;-tuple is too large for GHC&quot;</span></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-581"></span><span>                 </span><span class="annot"><span class="annottext">Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#nest"><span class="hs-identifier hs-var">nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;max size is&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#int"><span class="hs-identifier hs-var">int</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Settings.Constants.html#mAX_TUPLE_SIZE"><span class="hs-identifier hs-var">mAX_TUPLE_SIZE</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-582"></span><span>                 </span><span class="annot"><span class="annottext">Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#nest"><span class="hs-identifier hs-var">nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Workaround: use nested tuples or define a data type&quot;</span></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-583"></span><span>
</span><span id="line-584"></span><span>
</span><span id="line-585"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{Contexts for renaming errors}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-592"></span><span>
</span><span id="line-593"></span><span class="hs-comment">-- AZ:TODO: Change these all to be Name instead of RdrName.</span><span>
</span><span id="line-594"></span><span class="hs-comment">--          Merge TcType.UserTypeContext in to it.</span><span>
</span><span id="line-595"></span><span class="hs-keyword">data</span><span> </span><span id="HsDocContext"><span class="annot"><a href="GHC.Rename.Utils.html#HsDocContext"><span class="hs-identifier hs-var">HsDocContext</span></a></span></span><span>
</span><span id="line-596"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="TypeSigCtx"><span class="annot"><a href="GHC.Rename.Utils.html#TypeSigCtx"><span class="hs-identifier hs-var">TypeSigCtx</span></a></span></span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-597"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="StandaloneKindSigCtx"><span class="annot"><a href="GHC.Rename.Utils.html#StandaloneKindSigCtx"><span class="hs-identifier hs-var">StandaloneKindSigCtx</span></a></span></span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-598"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="PatCtx"><span class="annot"><a href="GHC.Rename.Utils.html#PatCtx"><span class="hs-identifier hs-var">PatCtx</span></a></span></span><span>
</span><span id="line-599"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="SpecInstSigCtx"><span class="annot"><a href="GHC.Rename.Utils.html#SpecInstSigCtx"><span class="hs-identifier hs-var">SpecInstSigCtx</span></a></span></span><span>
</span><span id="line-600"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="DefaultDeclCtx"><span class="annot"><a href="GHC.Rename.Utils.html#DefaultDeclCtx"><span class="hs-identifier hs-var">DefaultDeclCtx</span></a></span></span><span>
</span><span id="line-601"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="ForeignDeclCtx"><span class="annot"><a href="GHC.Rename.Utils.html#ForeignDeclCtx"><span class="hs-identifier hs-var">ForeignDeclCtx</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-602"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="DerivDeclCtx"><span class="annot"><a href="GHC.Rename.Utils.html#DerivDeclCtx"><span class="hs-identifier hs-var">DerivDeclCtx</span></a></span></span><span>
</span><span id="line-603"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="RuleCtx"><span class="annot"><a href="GHC.Rename.Utils.html#RuleCtx"><span class="hs-identifier hs-var">RuleCtx</span></a></span></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>
</span><span id="line-604"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="TyDataCtx"><span class="annot"><a href="GHC.Rename.Utils.html#TyDataCtx"><span class="hs-identifier hs-var">TyDataCtx</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-605"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="TySynCtx"><span class="annot"><a href="GHC.Rename.Utils.html#TySynCtx"><span class="hs-identifier hs-var">TySynCtx</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-606"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="TyFamilyCtx"><span class="annot"><a href="GHC.Rename.Utils.html#TyFamilyCtx"><span class="hs-identifier hs-var">TyFamilyCtx</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-607"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="FamPatCtx"><span class="annot"><a href="GHC.Rename.Utils.html#FamPatCtx"><span class="hs-identifier hs-var">FamPatCtx</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span class="hs-special">)</span><span>    </span><span class="hs-comment">-- The patterns of a type/data family instance</span><span>
</span><span id="line-608"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="ConDeclCtx"><span class="annot"><a href="GHC.Rename.Utils.html#ConDeclCtx"><span class="hs-identifier hs-var">ConDeclCtx</span></a></span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-609"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="ClassDeclCtx"><span class="annot"><a href="GHC.Rename.Utils.html#ClassDeclCtx"><span class="hs-identifier hs-var">ClassDeclCtx</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-610"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="ExprWithTySigCtx"><span class="annot"><a href="GHC.Rename.Utils.html#ExprWithTySigCtx"><span class="hs-identifier hs-var">ExprWithTySigCtx</span></a></span></span><span>
</span><span id="line-611"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="TypBrCtx"><span class="annot"><a href="GHC.Rename.Utils.html#TypBrCtx"><span class="hs-identifier hs-var">TypBrCtx</span></a></span></span><span>
</span><span id="line-612"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="HsTypeCtx"><span class="annot"><a href="GHC.Rename.Utils.html#HsTypeCtx"><span class="hs-identifier hs-var">HsTypeCtx</span></a></span></span><span>
</span><span id="line-613"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="GHCiCtx"><span class="annot"><a href="GHC.Rename.Utils.html#GHCiCtx"><span class="hs-identifier hs-var">GHCiCtx</span></a></span></span><span>
</span><span id="line-614"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="SpliceTypeCtx"><span class="annot"><a href="GHC.Rename.Utils.html#SpliceTypeCtx"><span class="hs-identifier hs-var">SpliceTypeCtx</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Type.html#LHsType"><span class="hs-identifier hs-type">LHsType</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-615"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="ClassInstanceCtx"><span class="annot"><a href="GHC.Rename.Utils.html#ClassInstanceCtx"><span class="hs-identifier hs-var">ClassInstanceCtx</span></a></span></span><span>
</span><span id="line-616"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="GenericCtx"><span class="annot"><a href="GHC.Rename.Utils.html#GenericCtx"><span class="hs-identifier hs-var">GenericCtx</span></a></span></span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>   </span><span class="hs-comment">-- Maybe we want to use this more!</span><span>
</span><span id="line-617"></span><span>
</span><span id="line-618"></span><span class="annot"><a href="GHC.Rename.Utils.html#withHsDocContext"><span class="hs-identifier hs-type">withHsDocContext</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#HsDocContext"><span class="hs-identifier hs-type">HsDocContext</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-619"></span><span id="withHsDocContext"><span class="annot"><span class="annottext">withHsDocContext :: HsDocContext -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Rename.Utils.html#withHsDocContext"><span class="hs-identifier hs-var hs-var">withHsDocContext</span></a></span></span><span> </span><span id="local-6989586621681108491"><span class="annot"><span class="annottext">HsDocContext
</span><a href="#local-6989586621681108491"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681108490"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108490"><span class="hs-identifier hs-var">doc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108490"><span class="hs-identifier hs-var">doc</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext -&gt; MsgDoc
</span><a href="GHC.Rename.Utils.html#inHsDocContext"><span class="hs-identifier hs-var">inHsDocContext</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext
</span><a href="#local-6989586621681108491"><span class="hs-identifier hs-var">ctxt</span></a></span><span>
</span><span id="line-620"></span><span>
</span><span id="line-621"></span><span class="annot"><a href="GHC.Rename.Utils.html#inHsDocContext"><span class="hs-identifier hs-type">inHsDocContext</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#HsDocContext"><span class="hs-identifier hs-type">HsDocContext</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-622"></span><span id="inHsDocContext"><span class="annot"><span class="annottext">inHsDocContext :: HsDocContext -&gt; MsgDoc
</span><a href="GHC.Rename.Utils.html#inHsDocContext"><span class="hs-identifier hs-var hs-var">inHsDocContext</span></a></span></span><span> </span><span id="local-6989586621681108489"><span class="annot"><span class="annottext">HsDocContext
</span><a href="#local-6989586621681108489"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;In&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext -&gt; MsgDoc
</span><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier hs-var">pprHsDocContext</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext
</span><a href="#local-6989586621681108489"><span class="hs-identifier hs-var">ctxt</span></a></span><span>
</span><span id="line-623"></span><span>
</span><span id="line-624"></span><span class="annot"><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier hs-type">pprHsDocContext</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#HsDocContext"><span class="hs-identifier hs-type">HsDocContext</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-625"></span><span id="pprHsDocContext"><span class="annot"><span class="annottext">pprHsDocContext :: HsDocContext -&gt; MsgDoc
</span><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier hs-var hs-var">pprHsDocContext</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Rename.Utils.html#GenericCtx"><span class="hs-identifier hs-type">GenericCtx</span></a></span><span> </span><span id="local-6989586621681108488"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108488"><span class="hs-identifier hs-var">doc</span></a></span></span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108488"><span class="hs-identifier hs-var">doc</span></a></span><span>
</span><span id="line-626"></span><span class="annot"><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier hs-var">pprHsDocContext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Rename.Utils.html#TypeSigCtx"><span class="hs-identifier hs-type">TypeSigCtx</span></a></span><span> </span><span id="local-6989586621681108487"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108487"><span class="hs-identifier hs-var">doc</span></a></span></span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;the type signature for&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108487"><span class="hs-identifier hs-var">doc</span></a></span><span>
</span><span id="line-627"></span><span class="annot"><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier hs-var">pprHsDocContext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Rename.Utils.html#StandaloneKindSigCtx"><span class="hs-identifier hs-type">StandaloneKindSigCtx</span></a></span><span> </span><span id="local-6989586621681108486"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108486"><span class="hs-identifier hs-var">doc</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;the standalone kind signature for&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681108486"><span class="hs-identifier hs-var">doc</span></a></span><span>
</span><span id="line-628"></span><span class="annot"><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier hs-var">pprHsDocContext</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext
</span><a href="GHC.Rename.Utils.html#PatCtx"><span class="hs-identifier hs-var">PatCtx</span></a></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;a pattern type-signature&quot;</span></span><span>
</span><span id="line-629"></span><span class="annot"><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier hs-var">pprHsDocContext</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext
</span><a href="GHC.Rename.Utils.html#SpecInstSigCtx"><span class="hs-identifier hs-var">SpecInstSigCtx</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;a SPECIALISE instance pragma&quot;</span></span><span>
</span><span id="line-630"></span><span class="annot"><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier hs-var">pprHsDocContext</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext
</span><a href="GHC.Rename.Utils.html#DefaultDeclCtx"><span class="hs-identifier hs-var">DefaultDeclCtx</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;a `default' declaration&quot;</span></span><span>
</span><span id="line-631"></span><span class="annot"><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier hs-var">pprHsDocContext</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext
</span><a href="GHC.Rename.Utils.html#DerivDeclCtx"><span class="hs-identifier hs-var">DerivDeclCtx</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;a deriving declaration&quot;</span></span><span>
</span><span id="line-632"></span><span class="annot"><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier hs-var">pprHsDocContext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Rename.Utils.html#RuleCtx"><span class="hs-identifier hs-type">RuleCtx</span></a></span><span> </span><span id="local-6989586621681108485"><span class="annot"><span class="annottext">FieldLabelString
</span><a href="#local-6989586621681108485"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;the rewrite rule&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#doubleQuotes"><span class="hs-identifier hs-var">doubleQuotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FieldLabelString -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ftext"><span class="hs-identifier hs-var">ftext</span></a></span><span> </span><span class="annot"><span class="annottext">FieldLabelString
</span><a href="#local-6989586621681108485"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-633"></span><span class="annot"><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier hs-var">pprHsDocContext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Rename.Utils.html#TyDataCtx"><span class="hs-identifier hs-type">TyDataCtx</span></a></span><span> </span><span id="local-6989586621681108482"><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681108482"><span class="hs-identifier hs-var">tycon</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;the data type declaration for&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located RdrName -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681108482"><span class="hs-identifier hs-var">tycon</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-634"></span><span class="annot"><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier hs-var">pprHsDocContext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Rename.Utils.html#FamPatCtx"><span class="hs-identifier hs-type">FamPatCtx</span></a></span><span> </span><span id="local-6989586621681108481"><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681108481"><span class="hs-identifier hs-var">tycon</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;a type pattern of family instance for&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located RdrName -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681108481"><span class="hs-identifier hs-var">tycon</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-635"></span><span class="annot"><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier hs-var">pprHsDocContext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Rename.Utils.html#TySynCtx"><span class="hs-identifier hs-type">TySynCtx</span></a></span><span> </span><span id="local-6989586621681108480"><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681108480"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;the declaration for type synonym&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located RdrName -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681108480"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-636"></span><span class="annot"><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier hs-var">pprHsDocContext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Rename.Utils.html#TyFamilyCtx"><span class="hs-identifier hs-type">TyFamilyCtx</span></a></span><span> </span><span id="local-6989586621681108479"><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681108479"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;the declaration for type family&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located RdrName -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681108479"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-637"></span><span class="annot"><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier hs-var">pprHsDocContext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Rename.Utils.html#ClassDeclCtx"><span class="hs-identifier hs-type">ClassDeclCtx</span></a></span><span> </span><span id="local-6989586621681108478"><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681108478"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;the declaration for class&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located RdrName -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681108478"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-638"></span><span class="annot"><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier hs-var">pprHsDocContext</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext
</span><a href="GHC.Rename.Utils.html#ExprWithTySigCtx"><span class="hs-identifier hs-var">ExprWithTySigCtx</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;an expression type signature&quot;</span></span><span>
</span><span id="line-639"></span><span class="annot"><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier hs-var">pprHsDocContext</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext
</span><a href="GHC.Rename.Utils.html#TypBrCtx"><span class="hs-identifier hs-var">TypBrCtx</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;a Template-Haskell quoted type&quot;</span></span><span>
</span><span id="line-640"></span><span class="annot"><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier hs-var">pprHsDocContext</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext
</span><a href="GHC.Rename.Utils.html#HsTypeCtx"><span class="hs-identifier hs-var">HsTypeCtx</span></a></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;a type argument&quot;</span></span><span>
</span><span id="line-641"></span><span class="annot"><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier hs-var">pprHsDocContext</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext
</span><a href="GHC.Rename.Utils.html#GHCiCtx"><span class="hs-identifier hs-var">GHCiCtx</span></a></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;GHCi input&quot;</span></span><span>
</span><span id="line-642"></span><span class="annot"><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier hs-var">pprHsDocContext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Rename.Utils.html#SpliceTypeCtx"><span class="hs-identifier hs-type">SpliceTypeCtx</span></a></span><span> </span><span id="local-6989586621681108477"><span class="annot"><span class="annottext">LHsType GhcPs
</span><a href="#local-6989586621681108477"><span class="hs-identifier hs-var">hs_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;the spliced type&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsType GhcPs -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsType GhcPs
</span><a href="#local-6989586621681108477"><span class="hs-identifier hs-var">hs_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-643"></span><span class="annot"><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier hs-var">pprHsDocContext</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext
</span><a href="GHC.Rename.Utils.html#ClassInstanceCtx"><span class="hs-identifier hs-var">ClassInstanceCtx</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;GHC.Tc.Gen.Splice.reifyInstances&quot;</span></span><span>
</span><span id="line-644"></span><span>
</span><span id="line-645"></span><span class="annot"><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier hs-var">pprHsDocContext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Rename.Utils.html#ForeignDeclCtx"><span class="hs-identifier hs-type">ForeignDeclCtx</span></a></span><span> </span><span id="local-6989586621681108476"><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681108476"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-646"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;the foreign declaration for&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located RdrName -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681108476"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-647"></span><span class="annot"><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier hs-var">pprHsDocContext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Rename.Utils.html#ConDeclCtx"><span class="hs-identifier hs-type">ConDeclCtx</span></a></span><span> </span><span class="hs-special">[</span><span id="local-6989586621681108475"><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681108475"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-648"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;the definition of data constructor&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located Name -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681108475"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-649"></span><span class="annot"><a href="GHC.Rename.Utils.html#pprHsDocContext"><span class="hs-identifier hs-var">pprHsDocContext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Rename.Utils.html#ConDeclCtx"><span class="hs-identifier hs-type">ConDeclCtx</span></a></span><span> </span><span id="local-6989586621681108474"><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681108474"><span class="hs-identifier hs-var">names</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-650"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;the definition of data constructors&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Located Name] -&gt; MsgDoc
forall a. Outputable a =&gt; [a] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#interpp%27SP"><span class="hs-identifier hs-var">interpp'SP</span></a></span><span> </span><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681108474"><span class="hs-identifier hs-var">names</span></a></span><span>
</span><span id="line-651"></span></pre></body></html>